diff options
author | DJ Delorie <dj@redhat.com> | 2008-11-12 11:35:03 -0500 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2008-11-12 11:35:03 -0500 |
commit | d2cf2f07a9eabdc50dd002970d3c6bf634ed1292 (patch) | |
tree | ece9aebff8260ed974540a05a22b91fa32dc6079 /gcc | |
parent | 429ce9927e78f2dab7393a739ecb193815b0b188 (diff) | |
download | gcc-d2cf2f07a9eabdc50dd002970d3c6bf634ed1292.zip gcc-d2cf2f07a9eabdc50dd002970d3c6bf634ed1292.tar.gz gcc-d2cf2f07a9eabdc50dd002970d3c6bf634ed1292.tar.bz2 |
cond.md (cond_to_int peephole2): Don't eliminate the insns if the intermediate value will be used later.
* config/m32c/cond.md (cond_to_int peephole2): Don't eliminate the
insns if the intermediate value will be used later.
From-SVN: r141788
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/m32c/cond.md | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7617fa7..dcfedb1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-11-12 DJ Delorie <dj@redhat.com> + + * config/m32c/cond.md (cond_to_int peephole2): Don't eliminate the + insns if the intermediate value will be used later. + 2008-11-12 Andreas Schwab <schwab@suse.de> * config/m68k/m68k.c (print_operand): Mask off extra extension diff --git a/gcc/config/m32c/cond.md b/gcc/config/m32c/cond.md index a01efe9..a64d3ca 100644 --- a/gcc/config/m32c/cond.md +++ b/gcc/config/m32c/cond.md @@ -300,7 +300,9 @@ [(set_attr "flags" "x")] ) -;; A cond_to_int followed by a compare against zero is essentially a no-op. +;; A cond_to_int followed by a compare against zero is essentially a +;; no-op. However, the result of the cond_to_int may be used by later +;; insns, so make sure it's dead before deleting its set. (define_peephole2 [(set (match_operand:HI 0 "mra_qi_operand" "") @@ -313,6 +315,7 @@ (compare (match_operand:HI 1 "mra_qi_operand" "") (const_int 0))) ] - "rtx_equal_p(operands[0], operands[1])" + "rtx_equal_p (operands[0], operands[1]) + && dead_or_set_p (peep2_next_insn (1), operands[0])" [(const_int 1)] "") |