]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-dse.c (dse_optimize_stmt): Remember the stmt basic-block before removing it.
authorRichard Guenther <rguenther@suse.de>
Thu, 5 Apr 2012 12:43:25 +0000 (12:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 5 Apr 2012 12:43:25 +0000 (12:43 +0000)
2012-04-05  Richard Guenther  <rguenther@suse.de>

* tree-ssa-dse.c (dse_optimize_stmt): Remember the stmt
basic-block before removing it.

From-SVN: r186164

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

index 827397000605aad00f985b52b76ba33f05c72426..d4db3357f4fe39e0e326054c926515c2355afbf4 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-05  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-dse.c (dse_optimize_stmt): Remember the stmt
+       basic-block before removing it.
+
 2012-04-05  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssanames.c (release_dead_ssa_names): Compact the SSA
index 93ba42506d78268928b0012f25e35855f9ac0a6f..1fdb26c5c70fc6e2144452f9d591cacaec83cea4 100644 (file)
@@ -232,6 +232,8 @@ dse_optimize_stmt (gimple_stmt_iterator gsi)
                                gimple_get_lhs (use_stmt), 0)))
          || stmt_kills_ref_p (use_stmt, gimple_assign_lhs (stmt)))
        {
+         basic_block bb;
+
          /* If use_stmt is or might be a nop assignment, e.g. for
             struct { ... } S a, b, *p; ...
             b = a; b = b;
@@ -258,8 +260,9 @@ dse_optimize_stmt (gimple_stmt_iterator gsi)
          unlink_stmt_vdef (stmt);
 
          /* Remove the dead store.  */
+         bb = gimple_bb (stmt);
          if (gsi_remove (&gsi, true))
-           bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
+           bitmap_set_bit (need_eh_cleanup, bb->index);
 
          /* And release any SSA_NAMEs set in this statement back to the
             SSA_NAME manager.  */