This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23286] missed fully redundant expression
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2010 12:56:45 -0000
- Subject: [Bug tree-optimization/23286] missed fully redundant expression
- References: <bug-23286-7849@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #28 from rguenth at gcc dot gnu dot org 2010-01-17 12:56 -------
sth like
@@ -3893,7 +3893,29 @@ insert_aux (basic_block block, bool do_p
/* Insert expressions for hoisting. */
if (do_hoist && EDGE_COUNT (block->succs) >= 2)
- new_stuff |= do_hoist_insertion (block);
+ {
+ edge e;
+ edge_iterator ei;
+
+ new_stuff |= do_hoist_insertion (block);
+
+ /* Immediately update AVAIL_OUT of immediately dominated blocks
+ with the hoisted expressions. */
+ newset = NEW_SETS (block);
+ if (newset)
+ FOR_EACH_EDGE (e, ei, block->succs)
+ {
+ if (EDGE_COUNT (e->dest->preds) != 1)
+ continue;
+
+ FOR_EACH_EXPR_ID_IN_SET (newset, i, bi)
+ {
+ pre_expr expr = expression_for_id (i);
+ bitmap_value_replace_in_set (NEW_SETS (e->dest), expr);
+ bitmap_value_replace_in_set (AVAIL_OUT (e->dest),
expr);
+ }
+ }
+ }
}
}
for (son = first_dom_son (CDI_DOMINATORS, block);
on top of the last patch
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23286