OSDN Git Service

(jump_optimize): Don't convert if (foo) x++ into an add of an scc
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jul 1994 23:25:58 +0000 (23:25 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jul 1994 23:25:58 +0000 (23:25 +0000)
unless X has no side effects and can't trap.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7638 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/jump.c

index 2f9621f..4cc90bb 100644 (file)
@@ -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