This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/11451] [m32r-elf] wrong code with -O at cmp_ne_small_const_insns
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Dec 2003 02:41:27 -0000
- Subject: [Bug target/11451] [m32r-elf] wrong code with -O at cmp_ne_small_const_insns
- References: <20030707110257.11451.inaoka.kazuhiro@renesas.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2003-12-11 02:41 -------
The following pattern looks definitely wrong.
As the comment says, how can ne:SI be handled using an addition?
To remove this, I would have to remove a lot of other things,
but I don't have target-specific knowledge.
;; reg == small constant comparisons are best handled by putting the result
;; of the comparison in a tmp reg and then using beqz/bnez.
;; ??? The result register doesn't contain 0/STORE_FLAG_VALUE,
;; it contains 0/nonzero.
(define_insn "cmp_ne_small_const_insn"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(ne:SI (match_operand:SI 1 "register_operand" "0,r")
(match_operand:SI 2 "cmp_int16_operand" "N,P")))]
""
"@
addi %0,%#%N2
add3 %0,%1,%#%N2"
[(set_attr "type" "int2,int4")
(set_attr "length" "2,4")])
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11451