This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][testsuite] Fix TORTURE_OPTIONS overriding


Currently when doing

make check-gcc RUNTESTFLAGS="TORTURE_OPTIONS=\\\"{ -O3 } { -O2 }\\\" 
dg-torture.exp"

you get -O3 and -O2 but also the two LTO torture option combinations.
That's undesired (those are the most expensive anyway).  The following
patch avoids this by setting LTO_TORTURE_OPTIONS only when
TORTURE_OPTIONS isn't specified.

Tested with and without TORTURE_OPTIONS for C and fortran tortures.

Seems the instruction in c-torture.exp how to override TORTURE_OPTIONS
is off, RUNTESTFLAGS="TORTURE_OPTIONS=\\\"{ { -O3 } { -O2 } }\\\"
certainly doesn't do what it should.

Ok for trunk?

Thanks,
Richard.

2015-06-18  Richard Biener  <rguenther@suse.de>

	* lib/c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on
	not existing TORTURE_OPTIONS only.
	* lib/gcc-dg.exp: Likewise.

Index: gcc/testsuite/lib/c-torture.exp
===================================================================
--- gcc/testsuite/lib/c-torture.exp	(revision 224545)
+++ gcc/testsuite/lib/c-torture.exp	(working copy)
@@ -22,8 +22,9 @@ load_lib target-libpath.exp
 load_lib target-utils.exp
 
 # The default option list can be overridden by
-# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
+# TORTURE_OPTIONS="{ list1 } ... { listN }"
 
+set LTO_TORTURE_OPTIONS ""
 if [info exists TORTURE_OPTIONS] {
     set C_TORTURE_OPTIONS $TORTURE_OPTIONS
 } else {
@@ -44,6 +45,22 @@ if [info exists TORTURE_OPTIONS] {
 	{ -O3 -g } \
 	{ -Os } \
 	{ -Og -g } ]
+
+    if [check_effective_target_lto] {
+        # When having plugin test both slim and fat LTO and plugin/nonplugin
+        # path.
+        if [check_linker_plugin_available] {
+          set LTO_TORTURE_OPTIONS [list \
+    	      { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
+	      { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
+          ]
+        } else {
+          set LTO_TORTURE_OPTIONS [list \
+	      { -O2 -flto -flto-partition=none } \
+	      { -O2 -flto }
+          ]
+        }
+    }
 }
 
 if [info exists ADDITIONAL_TORTURE_OPTIONS] {
@@ -65,23 +82,6 @@ if { $orig_environment_saved == 0 } {
     set_ld_library_path_env_vars
 }
 
-set LTO_TORTURE_OPTIONS ""
-if [check_effective_target_lto] {
-    # When having plugin test both slim and fat LTO and plugin/nonplugin
-    # path.
-    if [check_linker_plugin_available] {
-      set LTO_TORTURE_OPTIONS [list \
-	  { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
-	  { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
-      ]
-    } else {
-      set LTO_TORTURE_OPTIONS [list \
-	  { -O2 -flto -flto-partition=none } \
-	  { -O2 -flto }
-      ]
-    }
-}
-
 #
 # c-torture-compile -- runs the Tege C-torture test
 #
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 224545)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -46,6 +46,7 @@ if ![info exists GCC_UNDER_TEST] {
     set GCC_UNDER_TEST "[find_gcc]"
 }
 
+set LTO_TORTURE_OPTIONS ""
 if [info exists TORTURE_OPTIONS] {
     set DG_TORTURE_OPTIONS $TORTURE_OPTIONS
 } else {
@@ -65,6 +66,23 @@ if [info exists TORTURE_OPTIONS] {
 	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
 	{ -O3 -g } \
 	{ -Os } ]
+
+    if [check_effective_target_lto] {
+        # When having plugin test both slim and fat LTO and plugin/nonplugin
+        # path.
+	if [check_linker_plugin_available] {
+           set LTO_TORTURE_OPTIONS [list \
+	      { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
+	      { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
+           ]
+           set gcc_force_conventional_output "-ffat-lto-objects"
+        } else {
+           set LTO_TORTURE_OPTIONS [list \
+	      { -O2 -flto -flto-partition=none } \
+	      { -O2 -flto }
+           ]
+        }
+    }
 }
 
 if [info exists ADDITIONAL_TORTURE_OPTIONS] {
@@ -87,24 +105,6 @@ if { $orig_environment_saved == 0 } {
 global gcc_force_conventional_output
 set gcc_force_conventional_output ""
 
-set LTO_TORTURE_OPTIONS ""
-if [check_effective_target_lto] {
-    # When having plugin test both slim and fat LTO and plugin/nonplugin
-    # path.
-    if [check_linker_plugin_available] {
-      set LTO_TORTURE_OPTIONS [list \
-	  { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
-	  { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
-      ]
-      set gcc_force_conventional_output "-ffat-lto-objects"
-    } else {
-      set LTO_TORTURE_OPTIONS [list \
-	  { -O2 -flto -flto-partition=none } \
-	  { -O2 -flto }
-      ]
-    }
-}
-
 # Deduce generated files from tool flags, return finalcode string
 proc schedule-cleanups { opts } {
     global additional_sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]