This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/11451] [m32r-elf] wrong code with -O at cmp_ne_small_const_insns


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]