util-docker,tests: Add GCC-12 compiler image and test

This increases gem5's supported compiler up to GCC Version 12

Change-Id: Ifed5b8456bd1ab36a2fa58d8be7911acbef29bdd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64174
Reviewed-by: Kunal Pai <kunpai@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
diff --git a/tests/compiler-tests.sh b/tests/compiler-tests.sh
index cc8d4cf..dbe5dc9 100755
--- a/tests/compiler-tests.sh
+++ b/tests/compiler-tests.sh
@@ -13,7 +13,8 @@
 docker_mem_limit="18g"
 
 # All Docker images in the gem5 testing GCR which we want to compile with.
-images=("gcc-version-11"
+images=("gcc-version-12"
+        "gcc-version-11"
         "gcc-version-10"
         "gcc-version-9"
         "gcc-version-8"
@@ -34,7 +35,7 @@
 
 # A subset of the above list: these images will build against every target,
 # ignoring builds_per_compiler.
-comprehensive=("gcc-version-11"
+comprehensive=("gcc-version-12"
                "clang-version-12")
 
 # All build targets in build_opt/ which we want to build using each image.
diff --git a/util/dockerfiles/docker-compose.yaml b/util/dockerfiles/docker-compose.yaml
index 53111f1..26d816e 100644
--- a/util/dockerfiles/docker-compose.yaml
+++ b/util/dockerfiles/docker-compose.yaml
@@ -71,6 +71,13 @@
             args:
                 - version=11
         image: gcr.io/gem5-test/gcc-version-11
+    gcc-12:
+        build:
+            context: ubuntu-22.04_gcc-version
+            dockerfile: Dockerfile
+            args:
+                - version=12
+        image: gcr.io/gem5-test/gcc-version-12
     clang-6:
         build:
             context: ubuntu-18.04_clang-version
diff --git a/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile b/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile
index 121ac37..fcf909c 100644
--- a/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile
+++ b/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile
@@ -27,6 +27,7 @@
 
 # Valid version values:
 # 11
+# 12
 
 ARG version