summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 04:16:47 +0000
committertejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 04:16:47 +0000
commita7920b67d3445222ee084dc2f0552e385027833a (patch)
tree9a96a6100aed1345605dfb609da1d791d43f7d89
parenta291d9780e6cce724bac91b63c2d7b6d6fb9e2fb (diff)
downloadgcc-a7920b67d3445222ee084dc2f0552e385027833a.tar.gz
2013-11-21 Teresa Johnson <tejohnson@google.com>
PR target/59233 * cfgcleanup.c (outgoing_edges_match): Walk up past note instructions not understood by old_insns_match_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205243 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgcleanup.c16
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf4dee19d4d..35505f5f1d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-21 Teresa Johnson <tejohnson@google.com>
+
+ PR target/59233
+ * cfgcleanup.c (outgoing_edges_match): Walk up past note instructions
+ not understood by old_insns_match_p.
+
2013-11-21 Bill Schmidt <wschmidt@vnet.ibm.com>
* config/rs6000/vector.md (vec_pack_trunc_v2df): Revert previous
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index dbaee9667ab..234e5b64fe7 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1743,12 +1743,20 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
}
}
+ /* Find the last non-debug non-note instruction in each bb, except
+ stop when we see the NOTE_INSN_BASIC_BLOCK, as old_insns_match_p
+ handles that case specially. old_insns_match_p does not handle
+ other types of instruction notes. */
rtx last1 = BB_END (bb1);
rtx last2 = BB_END (bb2);
- if (DEBUG_INSN_P (last1))
- last1 = prev_nondebug_insn (last1);
- if (DEBUG_INSN_P (last2))
- last2 = prev_nondebug_insn (last2);
+ while (!NOTE_INSN_BASIC_BLOCK_P (last1) &&
+ (DEBUG_INSN_P (last1) || NOTE_P (last1)))
+ last1 = PREV_INSN (last1);
+ while (!NOTE_INSN_BASIC_BLOCK_P (last2) &&
+ (DEBUG_INSN_P (last2) || NOTE_P (last2)))
+ last2 = PREV_INSN (last2);
+ gcc_assert (last1 && last2);
+
/* First ensure that the instructions match. There may be many outgoing
edges so this test is generally cheaper. */
if (old_insns_match_p (mode, last1, last2) != dir_both)