aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-12-17 10:53:43 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2015-12-17 10:53:43 +0000
commita30c5ca4c15956697b2c78460be0a34811a2106e (patch)
tree76a7e5538586cca43ef71c911ae0791a047501ab /gcc/config
parent38fc3edcb9397eb37ce98ceee210eac823e6a92c (diff)
downloadgcc-a30c5ca4c15956697b2c78460be0a34811a2106e.zip
gcc-a30c5ca4c15956697b2c78460be0a34811a2106e.tar.gz
gcc-a30c5ca4c15956697b2c78460be0a34811a2106e.tar.bz2
arc.c (arc_loop_hazard): Don't convert the jump label rtx to an rtx_insn until we confirm it's not a...
2015-12-17 Andrew Burgess <andrew.burgess@embecosm.com> gcc: * config/arc/arc.c (arc_loop_hazard): Don't convert the jump label rtx to an rtx_insn until we confirm it's not a return rtx. gcc/testsuite: * gcc.target/arc/loop-hazard-1.c: New file From-SVN: r231752
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arc/arc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 513d138..d3a6f27 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -8041,6 +8041,7 @@ static bool
arc_loop_hazard (rtx_insn *pred, rtx_insn *succ)
{
rtx_insn *jump = NULL;
+ rtx label_rtx = NULL_RTX;
rtx_insn *label = NULL;
basic_block succ_bb;
@@ -8067,22 +8068,22 @@ arc_loop_hazard (rtx_insn *pred, rtx_insn *succ)
else
return false;
- label = JUMP_LABEL_AS_INSN (jump);
- if (!label)
- return false;
-
/* Phase 2b: Make sure is not a millicode jump. */
if ((GET_CODE (PATTERN (jump)) == PARALLEL)
&& (XVECEXP (PATTERN (jump), 0, 0) == ret_rtx))
return false;
- /* Phase 2c: Make sure is not a simple_return. */
- if ((GET_CODE (PATTERN (jump)) == SIMPLE_RETURN)
- || (GET_CODE (label) == SIMPLE_RETURN))
+ label_rtx = JUMP_LABEL (jump);
+ if (!label_rtx)
+ return false;
+
+ /* Phase 2c: Make sure is not a return. */
+ if (ANY_RETURN_P (label_rtx))
return false;
/* Pahse 2d: Go to the target of the jump and check for aliveness of
LP_COUNT register. */
+ label = safe_as_a <rtx_insn *> (label_rtx);
succ_bb = BLOCK_FOR_INSN (label);
if (!succ_bb)
{