This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SH: may miscompile zero extension and test
- From: Jim Wilson <wilson at tuliptree dot org>
- To: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: joern dot rennecke at superh dot com, aoliva at redhat dot com, gcc at gcc dot gnu dot org
- Date: Sat, 09 Aug 2003 23:31:19 -0700
- Subject: Re: SH: may miscompile zero extension and test
- References: <200308090800.h7980WD16266@r-rr.iij4u.or.jp>
kaz Kojima wrote:
(insn 52 51 53 1 (set (reg:SI 147 t)
(eq:SI (subreg:SI (reg:QI 178 [ a ]) 0)
(const_int 0 [0x0]))) 1 {cmpeqsi_t} (insn_list 50 (nil))
(expr_list:REG_DEAD (reg:QI 178 [ a ])
(nil)))
Subregs act much like regs when recognizing operands. So if (REG:SI
...) is a valid operand, then so is (subreg:SI ...).
The SH port defines WORD_REGISTER_OPERATIONS, which means if you put a
QImode value in a register, then you can interchangable use either
(reg:SI) or (reg:qi) because moving a QImode value sets the entire register.
You do have to get the signedness right though. There is some
interaction with LOAD_EXTEND_OP here to only generate the paradoxical
subreg when the signedness is OK. There are occasional problems with
this code.
It isn't obvious what is wrong from your assembly language fragment.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com