aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-03-04 14:37:57 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-03-04 14:37:57 -0800
commitc1e8e6bd23a05d7508d5669b386b625ca957a508 (patch)
treed1443d65bb8eeadc918357325fd6c027cc18b359
parentf2d82a9550c96f44251d01aec06b2cf589b4054d (diff)
downloadgcc-c1e8e6bd23a05d7508d5669b386b625ca957a508.zip
gcc-c1e8e6bd23a05d7508d5669b386b625ca957a508.tar.gz
gcc-c1e8e6bd23a05d7508d5669b386b625ca957a508.tar.bz2
(machine_dependent_reorg): In TARGET_RELAX code...
(machine_dependent_reorg): In TARGET_RELAX code, when scan forward from LINK, fail if pass a CODE_LABEL before finding INSN. Fail if SCAN not INSN is a JUMP_INSN. From-SVN: r11419
-rw-r--r--gcc/config/sh/sh.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1a9cda9..b561de7 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1548,23 +1548,33 @@ machine_dependent_reorg (first)
make sure that the only insns which use REG are
themselves function calls. */
+ /* ??? This doesn't work for call targets that were allocated
+ by reload, since there may not be a REG_DEAD note for the
+ register. */
+
dies = NULL_RTX;
for (scan = NEXT_INSN (link); scan; scan = NEXT_INSN (scan))
{
rtx scanset;
+ /* Don't try to trace forward past a CODE_LABEL if we haven't
+ seen INSN yet. Ordinarily, we will only find the setting insn
+ in LOG_LINKS if it is in the same basic block. However,
+ cross-jumping can insert code labels in between the load and
+ the call, and can result in situations where a single call
+ insn may have two targets depending on where we came from. */
+
+ if (GET_CODE (scan) == CODE_LABEL && ! foundinsn)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (scan)) != 'i')
continue;
/* Don't try to trace forward past a JUMP. To optimize
safely, we would have to check that all the
- instructions at the jump destination did not use REG.
- It should be safe to trace past a CODE_LABEL, because
- we will only find the setting insn in LOG_LINKS if it
- is in the same basic block (so probably we should
- never find a CODE_LABEL anyhow). */
+ instructions at the jump destination did not use REG. */
- if (GET_CODE (insn) == JUMP_INSN)
+ if (GET_CODE (scan) == JUMP_INSN)
break;
if (! reg_mentioned_p (reg, scan))