gimple-iterator.c (gsi_remove): Return whether EH edges need to be cleanup.
[gcc.git] / gcc / tree-ssa-pre.c
index 6a2ce643d7407c46f3d6dc1578777e80f5b8a02c..5e6f5708ad1c3063e4e186cb1985a809feff67e7 100644 (file)
@@ -4629,11 +4629,8 @@ eliminate (void)
          basic_block bb = gimple_bb (stmt);
          gsi = gsi_for_stmt (stmt);
          unlink_stmt_vdef (stmt);
-         gsi_remove (&gsi, true);
-         /* ???  gsi_remove doesn't tell us whether the stmt was
-            in EH tables and thus whether we need to purge EH edges.
-            Simply schedule the block for a cleanup.  */
-         bitmap_set_bit (need_eh_cleanup, bb->index);
+         if (gsi_remove (&gsi, true))
+           bitmap_set_bit (need_eh_cleanup, bb->index);
          if (TREE_CODE (lhs) == SSA_NAME)
            bitmap_clear_bit (inserted_exprs, SSA_NAME_VERSION (lhs));
          release_defs (stmt);