re PR rtl-optimization/31391 (undefined label with -O -g due to cfglayout)
authorSteven Bosscher <steven@gcc.gnu.org>
Sun, 1 Apr 2007 18:26:00 +0000 (18:26 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Sun, 1 Apr 2007 18:26:00 +0000 (18:26 +0000)
PR rtl-optimization/31391
* cfgcleanup.c (try_optimize_cfg): If a removed label is turned
into a DELETED_LABEL note, and the label is in an empty basic
block, update BB_END as well as BB_HEAD.

From-SVN: r123406

gcc/ChangeLog
gcc/cfgcleanup.c

index 81606be4cd3b71636447d692f1333ba0e3c0e4fd..2e2f90c6a64e708b2c2d8001f654562be8093f31 100644 (file)
@@ -1,3 +1,10 @@
+2007-04-01  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR rtl-optimization/31391
+       * cfgcleanup.c (try_optimize_cfg): If a removed label is turned
+       into a DELETED_LABEL note, and the label is in an empty basic
+       block, update BB_END as well as BB_HEAD.
+
 2007-04-01  Richard Henderson  <rth@redhat.com>
 
        PR tree-optimization/31169
index ee5c69bd2e6a3ec601e2b354cbb2d000e38086b5..c2595ea9dc7f88ca3ec8d6d765c8bd25e1ac1242 100644 (file)
@@ -2034,6 +2034,8 @@ try_optimize_cfg (int mode)
 
                      reorder_insns_nobb (label, label, bb_note);
                      BB_HEAD (b) = bb_note;
+                     if (BB_END (b) == bb_note)
+                       BB_END (b) = label;
                    }
                  if (dump_file)
                    fprintf (dump_file, "Deleted label in block %i.\n",