This is the mail archive of the 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]

Re: [RFA:] Fix PR 40086 - reorg.c again and again

> No, as safe correctness was the issue I prioritized re-using the
> previous solution.  I thought it couldn't happen too often, or
> this bug would have been noticed before.  What indications of
> non-pessimization do you require?

For example looking at the impact on gcc.c-torture/compile at -O2 to get a 
quick idea.  I've attached a patch (originally from Richard S. IIRC) that 
preserves the assembly files generated for this directory.

> I'm pretty sure it's needed everywhere.  I thought I made the
> point that PR15296 is virtually the same!  What effects would
> the DF change have?  IIUC better live information (less live
> registers) only aggravates the problem, it does not cause it.

Yes, but patching branches is not (usually) allowed if you don't have a 
testcase exhibiting a regression on the branches.

Eric Botcazou
Index: lib/gcc-dg.exp
--- lib/gcc-dg.exp	(revision 147032)
+++ lib/gcc-dg.exp	(working copy)
@@ -34,6 +34,8 @@ load_lib torture-options.exp
 setenv LC_ALL C
 setenv LANG C
+set TORTURE_OPTIONS [list { -O2 } ]
 if [info exists TORTURE_OPTIONS] {
 } else {
@@ -235,9 +237,15 @@ proc search_for { file pattern } {
 # Modified dg-runtest that can cycle through a list of optimization options
 # as c-torture does.
-proc gcc-dg-runtest { testcases default-extra-flags } {
+proc gcc-dg-runtest { testcases default-extra-flags keep } {
     global runtests
+    set flag1 ""
+    if { $keep } {
+	set flag1 "-keep-output"
+    }
     # Some callers set torture options themselves; don't override those.
     set existing_torture_options [torture-options-exist]
     if { $existing_torture_options == 0 } {
@@ -267,7 +275,7 @@ proc gcc-dg-runtest { testcases default-
 	foreach flags $option_list {
 	    verbose "Testing $nshort, $flags" 1
-	    dg-test $test $flags ${default-extra-flags}
+	    dg-test $flag1 $test $flags ${default-extra-flags}
Index: gcc.c-torture/compile/compile.exp
--- gcc.c-torture/compile/compile.exp	(revision 147032)
+++ gcc.c-torture/compile/compile.exp	(working copy)
@@ -26,8 +26,8 @@ dg-init
 # Main loop.
 set saved-dg-do-what-default ${dg-do-what-default}
-set dg-do-what-default "assemble"
-gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-w"
+set dg-do-what-default "compile"
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-w" 1
 set dg-do-what-default ${saved-dg-do-what-default}
 # All done.

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