aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristian Bruel <christian.bruel@st.com>2012-07-19 13:56:09 +0200
committerChristian Bruel <chrbr@gcc.gnu.org>2012-07-19 13:56:09 +0200
commit867ff7ed192fe7f614ad5c5429519f7e865e20f0 (patch)
treefe0126199a92fbdf278c300ebc554dfe4466a58f /gcc
parent95cbf8515a67cc41daa12f858d5db1277f1f2fa0 (diff)
downloadgcc-867ff7ed192fe7f614ad5c5429519f7e865e20f0.zip
gcc-867ff7ed192fe7f614ad5c5429519f7e865e20f0.tar.gz
gcc-867ff7ed192fe7f614ad5c5429519f7e865e20f0.tar.bz2
re PR target/54029 (SH: ICE in find_dead_or_set_registers)
PR target/54029 * config/sh/sh.c (gen_far_branch): Set JUMP_LABEL for return jumps. From-SVN: r189652
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4e8816a..1ad278a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-19 Christian Bruel <christian.bruel@st.com>
+
+ PR target/54029
+ * config/sh/sh.c (gen_far_branch): Set JUMP_LABEL for return jumps.
+
2012-07-19 Richard Guenther <rguenther@suse.de>
Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index df39858..02a3734 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5304,6 +5304,7 @@ gen_far_branch (struct far_branch *bp)
}
else
jump = emit_jump_insn_after (gen_return (), insn);
+
/* Emit a barrier so that reorg knows that any following instructions
are not reachable via a fall-through path.
But don't do this when not optimizing, since we wouldn't suppress the
@@ -5312,10 +5313,19 @@ gen_far_branch (struct far_branch *bp)
if (optimize)
emit_barrier_after (jump);
emit_label_after (bp->near_label, insn);
- JUMP_LABEL (jump) = bp->far_label;
+
+ if (bp->far_label)
+ JUMP_LABEL (jump) = bp->far_label;
+ else
+ {
+ rtx pat = PATTERN (jump);
+ gcc_assert (ANY_RETURN_P (pat));
+ JUMP_LABEL (jump) = pat;
+ }
+
ok = invert_jump (insn, label, 1);
gcc_assert (ok);
-
+
/* If we are branching around a jump (rather than a return), prevent
reorg from using an insn from the jump target as the delay slot insn -
when reorg did this, it pessimized code (we rather hide the delay slot)