tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not propagate an ADDR_EXPR...
authorJeff Law <law@redhat.com>
Wed, 18 May 2005 16:49:49 +0000 (10:49 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 18 May 2005 16:49:49 +0000 (10:49 -0600)
        * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
        propagate an ADDR_EXPR if the definition and use sites are
        in different EH regions.

From-SVN: r99906

gcc/ChangeLog
gcc/tree-ssa-forwprop.c

index a112e174ab2ade278d570b53d62bbf20a8c15bb6..acc2bcb0610e28e2d60a45f8f2e2ae4a501b2694 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-18  Jeff Law  <law@redhat.com>
+
+       * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
+       propagate an ADDR_EXPR if the definition and use sites are
+       in different EH regions.
+
 2005-05-18  Ian Lance Taylor  <ian@airs.com>
 
        * read-rtl.c (mode_attr_index): Use obstack_grow0, not
index fb3dcaf6ea81ea01439b74bed99422f6154d2c14..f65df577cb36589a3079c832f2997c0ef2fcb986 100644 (file)
@@ -537,6 +537,11 @@ forward_propagate_addr_expr (tree stmt)
   if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
     return false;
 
+  /* If the two statements belong to different EH regions, then there
+     is nothing we can or should try to do.  */
+  if (lookup_stmt_eh_region (use_stmt) != lookup_stmt_eh_region (stmt))
+    return false;
+
   /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.  */
   lhs = TREE_OPERAND (use_stmt, 0);
   while (TREE_CODE (lhs) == COMPONENT_REF || TREE_CODE (lhs) == ARRAY_REF)