]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: testsuite: Keep -mtune=generic when specifying -moverride
authorSpencer Abson <spencer.abson@arm.com>
Mon, 14 Jul 2025 17:00:12 +0000 (17:00 +0000)
committerSpencer Abson <spencer.abson@arm.com>
Wed, 23 Jul 2025 12:27:07 +0000 (12:27 +0000)
gcc/testsuite/ChangeLog:

* lib/gcc-defs.exp (aarch64-arg-dg-options): Split add_tune into
add_tune and add_override, so that specifying -moverride does not
change the baseline tuning from the testuite's default (generic).

gcc/testsuite/lib/gcc-defs.exp

index 2f8b7d488691cc69ccca256864dfaebf3c9b40ac..d66c833452cce59f4941279fcb58ab0928b7584f 100644 (file)
@@ -599,15 +599,16 @@ proc aarch64-arch-dg-options { args } {
 
     set add_arch 1
     set add_tune 1
+    set add_override 1
     set checks_output [string equal [lindex $do_what 0] "compile"]
     set options [lindex $args 1]
 
     foreach option [split $options] {
        switch -glob -- $option {
            -march=* { set add_arch 0 }
-           -mcpu=* { set add_arch 0; set add_tune 0 }
-           -mtune=* { set add_tune 0 }
-           -moverride=* { set add_tune 0 }
+           -mcpu=* { set add_arch 0; set add_tune 0; set add_override 0}
+           -mtune=* { set add_tune 0; set add_override 0 }
+           -moverride=* { set add_override 0 }
            -save-temps { set checks_output 1 }
            --save-temps { set checks_output 1 }
            -fdump* { set checks_output 1 }
@@ -619,9 +620,14 @@ proc aarch64-arch-dg-options { args } {
        append options " $aarch64_default_testing_arch"
     }
 
-    if { $add_tune && $checks_output } {
+    if { $checks_output } {
        # Turn off any default tuning and codegen tweaks.
-       append options " -mtune=generic -moverride=tune=none"
+        if { $add_tune } {
+            append options " -mtune=generic"
+        }
+        if { $add_override } {
+            append options " -moverride=tune=none"
+        }
     }
 
     uplevel 1 aarch64-old-dg-options [lreplace $args 1 1 $options]