summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-16 08:04:31 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-16 08:04:31 +0000
commit4c9c653969942f507a71a13aed00831daf2a59ff (patch)
tree648a9056f458a6ed079dbf829e143f96eb75dfb8 /gcc/jump.c
parentc4b4be7f287f7cd86a3b36c2f25c79558ecd6180 (diff)
downloadgcc-4c9c653969942f507a71a13aed00831daf2a59ff.tar.gz
PR rtl-optimization/65980
* jump.c (rtx_renumbered_equal_p) <case LABEL_REF>: Use next_nonnote_nondebug_insn instead of next_real_insn and skip over CODE_LABELs too. * gcc.dg/pr65980.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index c41710db73d..79188f4bc65 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1802,8 +1802,16 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
/* Two label-refs are equivalent if they point at labels
in the same position in the instruction stream. */
- return (next_real_insn (LABEL_REF_LABEL (x))
- == next_real_insn (LABEL_REF_LABEL (y)));
+ else
+ {
+ rtx_insn *xi = next_nonnote_nondebug_insn (LABEL_REF_LABEL (x));
+ rtx_insn *yi = next_nonnote_nondebug_insn (LABEL_REF_LABEL (y));
+ while (xi && LABEL_P (xi))
+ xi = next_nonnote_nondebug_insn (xi);
+ while (yi && LABEL_P (yi))
+ yi = next_nonnote_nondebug_insn (yi);
+ return xi == yi;
+ }
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);