This fixes the maybe_clean_or_replace_eh_stmt call in
replace_uses_by.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2011-12-13  Richard Guenther  <rguent...@suse.de>

        PR middle-end/51481
        * tree-cfg.c (replace_uses_by): Pass proper arguments to
        maybe_clean_or_replace_eh_stmt.

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c      (revision 182220)
+++ gcc/tree-cfg.c      (working copy)
@@ -1601,6 +1605,7 @@ replace_uses_by (tree name, tree val)
       if (gimple_code (stmt) != GIMPLE_PHI)
        {
          gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+         gimple orig_stmt = stmt;
          size_t i;
 
          fold_stmt (&gsi);
@@ -1619,7 +1624,7 @@ replace_uses_by (tree name, tree val)
                recompute_tree_invariant_for_addr_expr (op);
            }
 
-         maybe_clean_or_replace_eh_stmt (stmt, stmt);
+         maybe_clean_or_replace_eh_stmt (orig_stmt, stmt);
          update_stmt (stmt);
        }
     }

Reply via email to