aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-03-11 10:12:30 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-03-11 10:12:30 -0800
commit9740123d5c5e2fd32c7413dd9bdbdabdbb6b07b2 (patch)
tree2a53ff3f2d6ce490d198c0c9e372b9b4f35979bf
parent8319988283e6855de0b07f30c76c2bb06f583ee8 (diff)
downloadgcc-9740123d5c5e2fd32c7413dd9bdbdabdbb6b07b2.zip
gcc-9740123d5c5e2fd32c7413dd9bdbdabdbb6b07b2.tar.gz
gcc-9740123d5c5e2fd32c7413dd9bdbdabdbb6b07b2.tar.bz2
(jump_optimize): When handle a USE insn before an unconditional jump...
(jump_optimize): When handle a USE insn before an unconditional jump, disable the optimization if the USE is the only insn in the loop. From-SVN: r11512
-rw-r--r--gcc/jump.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index f668a47..2b9218a 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -682,7 +682,15 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& (temp1 = prev_nonnote_insn (JUMP_LABEL (insn))) != 0
&& (GET_CODE (temp1) == BARRIER
|| (GET_CODE (temp1) == INSN
- && rtx_equal_p (PATTERN (temp), PATTERN (temp1)))))
+ && rtx_equal_p (PATTERN (temp), PATTERN (temp1))))
+ /* Don't do this optimization if we have a loop containing only
+ the USE instruction, and the loop start label has a usage
+ count of 1. This is because we will redo this optimization
+ everytime through the outer loop, and jump opt will never
+ exit. */
+ && ! ((temp2 = prev_nonnote_insn (temp)) != 0
+ && temp2 == JUMP_LABEL (insn)
+ && LABEL_NUSES (temp2) == 1))
{
if (GET_CODE (temp1) == BARRIER)
{