]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Enable ztso tests on rv32
authorPatrick O'Neill <patrick@rivosinc.com>
Mon, 30 Oct 2023 23:54:40 +0000 (16:54 -0700)
committerPatrick O'Neill <patrick@rivosinc.com>
Wed, 1 Nov 2023 22:02:48 +0000 (15:02 -0700)
This patch transitions the ztso testcases to use the testsuite infrastructure,
enabling the tests on both rv64 and rv32 targets.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/amo-table-ztso-amo-add-1.c: Add Ztso extension to
dg-options for dg-do compile.
* gcc.target/riscv/amo-table-ztso-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-6.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-7.c: Ditto.
* gcc.target/riscv/amo-table-ztso-fence-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-fence-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-fence-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-fence-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-fence-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-load-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-load-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-load-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-store-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-store-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-store-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-5.c: Ditto.
* lib/target-supports.exp: Add testing infrastructure to require the
Ztso extension or add it to an existing -march.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
29 files changed:
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-6.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-7.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-fence-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-fence-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-fence-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-fence-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-fence-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-load-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-load-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-load-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-store-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-store-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-store-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-5.c
gcc/testsuite/lib/target-supports.exp

index a88d08eb3f40ed1eb4b6f4063ec87cab8f5c2253..65a4351025d55d09c8ce8e8aeafc9f9eaef99d70 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index ebd240f9dd2f5c4350d75db0e0e8323d3e1140cd..03da6b04de09cee73bfa83199ddd10090ffb7928 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index ee00d222eceac4fa44ca08156337d592df847bf4..695306e9d6f347ed7616303c6090e38e461c4fbc 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index ff08811c5d708aa0ace539adc0eeee8dd101e73f..e7e5ac7cc88f56201eaf3ba5b7e04ed42e76da86 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index b129df4b6071effa6275cd241c2959992f5f045e..457d0b12fbe6f21e1aa891d7e8a7919d3d9379cf 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 9d5b8c2a5f6364216c09776a2ee2f87ee55249be..dd6b5c24aa017c079091c3bceaa51818e8e59a89 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 57d6746ee220e017aa17602a92b24aaffe4d8826..b0bafa3296e24c568d8d432a02cfaeda2fe523da 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index d0044106d36041098a2b26dd9b88a9228940778f..78cb8aa9748ae6510a741aa4d07088593db5e02a 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 6a53473e26bb8ec11f8c16d29b95929e1d83e287..0656b84c7873bc56d892360b90015101cb2bd085 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 80729091c73058f085d53f024aa7846789f0943e..33d486c26cacab13b89a832e16679c77992a8371 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index 731f7f84af4cef8e72d12f803b7ed91ae54ba5d8..f8331bfcd0d464d0303872cc085fa5ce5293b0f4 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 3806d55da1d85344ed229298aa515008bd87c4d6..b5c42e1df1df6fd5dec615dc844925190bcb32b3 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index 81f2f9fbbd68eec2915f9def90bb3e4a7d77fb87..ec008d257943ce8dd6bf76e882145d1fabeb098d 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that fence mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 8e868890bae6999208fcfbaae6205d88409cb334..acef911573fe019dc564bf5f92074f470d37189a 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that fence mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 5eb1aa7f47200b1f3d368de2e965e24231319602..6931ba0a79928b14ab2af4f872b9021b4e58f30b 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that fence mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 3df959a3eb020916fa9542517f79033f4b20e118..b5a04294ad058f8fc80f49cadd1fa70593222d70 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that fence mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 731f9a342677ae425cb4239a1b42dcc57a38be14..860fb978cbc1d567b7aa4d0f23311859b883e0c1 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that fence mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index b911a6e3207eedbd41de0759c030803f0209ead0..631977985bd5309c21c563d82638f09c363750be 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that load mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 056506f637023a77745ebec9fbc9755f5a90a63a..2c24f10fb44dc6a94f622f24c9e88df6bbfe8174 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that load mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 35a301f321d9b89cc0d891d0f9d13aed18565f21..7d2166d29c050a950055ac3a86e3735815e869fa 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that load mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index f0bda4b242074713d8dc7895cc84c01d9ac93da6..29a770285ef6df64779f62495cd1e59d144c6d7b 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that store mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 45f73056aa4f0b47ca32f6ebbefe03c627765d77..fb82360ad336f18db1cf53e379db5bbf168a0514 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that store mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 762468b248e855f0623a2f409b31e8beeb8d1611..88d8432d8c9bf4c3212249539685af514116fb4a 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* Verify that store mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d -O3" } */
+/* { dg-options "-O3" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index e9ae506f32c04762b33588e0665d2f27c17297fd..3ba69ebc325333288cd02644b4668318de37f1f2 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index f47922f13e46c06fe5706ee57acb2da8cdf67998..4f38ed3015c0b379149cb90e452d656ec970b29c 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 296387ad07cb91ecf206b1423dbe4d6d891e5cae..e5bcb1275521b9e5835af1b95228124420d295b9 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index f919ede73032db827e9206e7a89e41076bc2cf31..316183c268b5ea01f257787adbad2bd68598f56d 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 2027a93218cb6a9d38a5e33a13c1eecb0e4b2a4e..fc1aa8d94f131c79158dbade9e94a49c70f98fbd 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-options "-march=rv64id_ztso -mabi=lp64d" } */
+/* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index 81330c4ba556203bad7951afaa3f4d7a3e6091b1..a5f393e1c1031b5f6fcc205dc91c1194b569a615 100644 (file)
@@ -1961,6 +1961,17 @@ proc check_effective_target_riscv_zfh { } {
     }]
 }
 
+# Return 1 if the target arch supports the TSO memory ordering extension,
+# 0 otherwise. Cache the result.
+
+proc check_effective_target_riscv_ztso { } {
+    return [check_no_compiler_messages riscv_ext_ztso assembly {
+       #ifndef __riscv_ztso
+       #error "Not __riscv_ztso"
+       #endif
+    }]
+}
+
 # Return 1 if we can execute code when using dg-add-options riscv_v
 
 proc check_effective_target_riscv_v_ok { } {
@@ -2040,7 +2051,7 @@ proc check_effective_target_riscv_zvfh_ok { } {
 proc riscv_get_arch { } {
     set gcc_march ""
     # ??? do we neeed to add more extensions to the list below?
-    foreach ext { i m a f d q c v zicsr zifencei zfh zba zbb zbc zbs zvfh } {
+    foreach ext { i m a f d q c v zicsr zifencei zfh zba zbb zbc zbs zvfh ztso } {
        if { [check_no_compiler_messages  riscv_ext_$ext assembly [string map [list DEF __riscv_$ext] {
                #ifndef DEF
                #error "Not DEF"
@@ -2111,6 +2122,18 @@ proc add_options_for_riscv_zfh { flags } {
     return "$flags -march=[riscv_get_arch]_zfh"
 }
 
+proc add_options_for_riscv_ztso { flags } {
+    if { [lsearch $flags -march=*] >= 0 } {
+       # If there are multiple -march flags, we have to adjust all of them.
+       set flags [regsub -all -- {(?:^|[[:space:]])-march=[[:alnum:]_.]*} $flags &_ztso ]
+       return [regsub -all -- {((?:^|[[:space:]])-march=[[:alnum:]_.]*_ztso[[:alnum:]_.]*)_ztso} $flags \\1 ]
+    }
+    if { [check_effective_target_riscv_ztso] } {
+       return "$flags"
+    }
+    return "$flags -march=[riscv_get_arch]_ztso"
+}
+
 proc add_options_for_riscv_zvfh { flags } {
     if { [lsearch $flags -march=*] >= 0 } {
        # If there are multiple -march flags, we have to adjust all of them.