This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix PR tree-optimization/21532
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 May 2005 13:10:22 -0400
- Subject: [PATCH]: Fix PR tree-optimization/21532
Stupid mistake (also affects 4.0, though the 21532 testcase won't show
it).
We forgot to throw the force_gimple_operand statements on the
inserted_exprs worklist, so sometimes we'd leave dead code that
referenced removed variables :(.
The testcase with 21532 is too large to commit, however, here is another
patch coming that is actually an improvement to PRE Steven Bosscher made
that has a small testcase exposing this in conjunction with the patch.
So i'll commit a small testcase for this bug when that improvement goes
in later today.
Bootstrapped and regtested on i686-pc-linux-gnu
Committed to mainline (a 4.0 version of the fix is coming)
--Dan
2005-05-12 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/21532
* tree-ssa-pre.c (create_expression_by_pieces): stmt
needs to go onto the inserted_exprs list.
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.84
diff -u -p -r2.84 tree-ssa-pre.c
--- tree-ssa-pre.c 3 May 2005 12:19:47 -0000 2.84
+++ tree-ssa-pre.c 12 May 2005 15:37:47 -0000
@@ -1369,6 +1402,8 @@ create_expression_by_pieces (basic_block
tree forcedname = TREE_OPERAND (stmt, 0);
tree forcedexpr = TREE_OPERAND (stmt, 1);
tree val = vn_lookup_or_add (forcedexpr, NULL);
+
+ VEC_safe_push (tree, heap, inserted_exprs, stmt);
vn_add (forcedname, val, NULL);
bitmap_value_replace_in_set (NEW_SETS (block), forcedname);
bitmap_value_replace_in_set (AVAIL_OUT (block), forcedname);