aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2013-02-06 08:53:32 +0000
committerTom de Vries <vries@gcc.gnu.org>2013-02-06 08:53:32 +0000
commit0f33baa989f17b16f68834c53ad6f3dc0f65ff04 (patch)
treeca54b3585d08d40b34f312f18036389003e459f4 /gcc
parentc8ab2cfaff7352e54df917ace1ce91e9ccd82506 (diff)
downloadgcc-0f33baa989f17b16f68834c53ad6f3dc0f65ff04.zip
gcc-0f33baa989f17b16f68834c53ad6f3dc0f65ff04.tar.gz
gcc-0f33baa989f17b16f68834c53ad6f3dc0f65ff04.tar.bz2
re PR rtl-optimization/56131 (gcc.dg/pr56035.c ICEs gcc on sparc-linux)
2013-02-06 Tom de Vries <tom@codesourcery.com> PR rtl-optimization/56131 * cfgrtl.c (delete_insn): Use NOTE_BASIC_BLOCK instead of BLOCK_FOR_INSN to get the bb of a NOTE_INSN_BASIC_BLOCK. Handle the case that the bb of the label is NULL. Add comment. From-SVN: r195784
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cfgrtl.c12
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ffe1af3..44e77f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-06 Tom de Vries <tom@codesourcery.com>
+
+ PR rtl-optimization/56131
+ * cfgrtl.c (delete_insn): Use NOTE_BASIC_BLOCK instead of BLOCK_FOR_INSN
+ to get the bb of a NOTE_INSN_BASIC_BLOCK. Handle the case that the bb
+ of the label is NULL. Add comment.
+
2013-02-05 Jakub Jelinek <jakub@redhat.com>
* tree.h (struct tree_decl_with_vis): Remove thread_local field.
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index ba07f89..c6ed44f 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -135,7 +135,7 @@ delete_insn (rtx insn)
if (! can_delete_label_p (insn))
{
const char *name = LABEL_NAME (insn);
- basic_block bb = BLOCK_FOR_INSN (insn);
+ basic_block bb, label_bb = BLOCK_FOR_INSN (insn);
rtx bb_note = NEXT_INSN (insn);
really_delete = false;
@@ -143,10 +143,16 @@ delete_insn (rtx insn)
NOTE_KIND (insn) = NOTE_INSN_DELETED_LABEL;
NOTE_DELETED_LABEL_NAME (insn) = name;
- if (bb_note != NULL_RTX && NOTE_INSN_BASIC_BLOCK_P (bb_note)
- && BLOCK_FOR_INSN (bb_note) == bb)
+ /* If the note following the label starts a basic block, and the
+ label is a member of the same basic block, interchange the two.
+ If the label is not marked with a bb, assume it's the same bb. */
+ if (bb_note != NULL_RTX
+ && NOTE_INSN_BASIC_BLOCK_P (bb_note)
+ && (label_bb == NOTE_BASIC_BLOCK (bb_note)
+ || label_bb == NULL))
{
reorder_insns_nobb (insn, insn, bb_note);
+ bb = NOTE_BASIC_BLOCK (bb_note);
BB_HEAD (bb) = bb_note;
if (BB_END (bb) == bb_note)
BB_END (bb) = insn;