aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-07-01 19:25:58 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-07-01 19:25:58 -0400
commit8743ede9fbe9b575a953459f21852dd3cf85bbc0 (patch)
treee6168fbaba495cd137e3a4f565ffb23ac42ca948
parenta78bdb8ef83adab0b35e08b7230d53768102e1b2 (diff)
downloadgcc-8743ede9fbe9b575a953459f21852dd3cf85bbc0.zip
gcc-8743ede9fbe9b575a953459f21852dd3cf85bbc0.tar.gz
gcc-8743ede9fbe9b575a953459f21852dd3cf85bbc0.tar.bz2
(jump_optimize): Don't convert if (foo) x++ into an add of an scc
unless X has no side effects and can't trap. From-SVN: r7638
-rw-r--r--gcc/jump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 2f9621f..4cc90bb 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1248,6 +1248,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& (XEXP (SET_SRC (temp1), 1) == const1_rtx
|| XEXP (SET_SRC (temp1), 1) == constm1_rtx)
&& rtx_equal_p (temp2, XEXP (SET_SRC (temp1), 0))
+ && ! side_effects_p (temp2)
+ && ! may_trap_p (temp2)
/* INSN must either branch to the insn after TEMP or the insn
after TEMP must branch to the same place as INSN. */
&& (reallabelprev == temp