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]

[4.4 regression] Fix PR tree-optimization/36792


Fixed by not inserting defs into the maximal set (insert defs will
never help) instead letting expressions get inserted in there.
This lets us properly hoist the loads out of the no-scevccp-outer7.c
and no-scevccp-outer13.c
It also caused a spurious failure in ssa-fre-10.c because we now move
one of the loads out of the loop (none of the stores, of course).
After talking with Richard Guenther, neither of us can figure out why
we were testing that :)

(It's also a PRE test masquerading as an FRE test, but c'est la vie).

Bootstrapped and regtested on x86-64-linux and i686-darwin
Committed to mainline.

2008-12-10  Daniel Berlin  <dberlin@dberlin.org>

	PR tree-optimization/36792
	* tree-ssa-pre.c (compute_avail): Don't insert defs into maximal
	set.

testsuite changelog:

2008-12-10  Daniel Berlin  <dberlin@dberlin.org>

        PR tree-optimization/36792
        * gcc.dg/tree-ssa/ssa-fre-10.c: Update expected results.
diff -r 56fd6de71d2e gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c	Tue Dec 09 17:04:26 2008 +0000
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c	Wed Dec 10 14:27:02 2008 -0500
@@ -4,6 +4,8 @@
 union loc {  unsigned reg; signed offset; };
 void __frame_state_for (volatile char *state_in, int x)
 {
+  /* We should move all the loads out of this loop. Right now, we only
+     move one.  It takes two insertions because we insert a cast.  */
     union loc fs;
     int reg;
     for (;;)     {
@@ -16,5 +18,5 @@
     }
 }
 
-/* { dg-final { scan-tree-dump-not "Insertions:" "pre" } } */
+/* { dg-final { scan-tree-dump "Insertions: 2" "pre" } } */
 /* { dg-final { cleanup-tree-dump "pre" } } */
diff -r 56fd6de71d2e gcc/tree-ssa-pre.c
--- a/gcc/tree-ssa-pre.c	Tue Dec 09 17:04:26 2008 +0000
+++ b/gcc/tree-ssa-pre.c	Wed Dec 10 14:27:02 2008 -0500
@@ -3644,10 +3644,7 @@
 
 	      add_to_value (get_expr_value_id (e), e);
 	      if (!in_fre)
-		{
-		  bitmap_insert_into_set (TMP_GEN (block), e);
-		  bitmap_value_insert_into_set (maximal_set, e);
-		}
+		bitmap_insert_into_set (TMP_GEN (block), e);
 	      bitmap_value_insert_into_set (AVAIL_OUT (block), e);
 	    }
 

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