This is the mail archive of the gcc-patches@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]

Re: RS6000 fix pr16480


On Wed, Aug 25, 2004 at 11:27:47AM -0400, David Edelsohn wrote:
> 	Is removing the REG_P test and abort really safe?  We've gone from
> 
> 	if (!REG_P (breg))
> 	  abort();
> 	if (REGNO (breg) >= REGNO (dst)
> 	...
> 
> to
> 
> 	if (REG_P (breg)
> 	    && REGNO (breg) >= REGNO (dst)
> 	...
> 
> Either the REG_P test now is redundant or we silently will generate
> incorrect code if we happen not to have a REG.

I should have made it clear in my patch submission:  I didn't just
simply remove the abort to work around a problem.  Instead, I looked at
all the types of address that rs6000_legitimate_address allows.  The
REG_P test is necessary, and I think the rs6000_split_multireg_move code
now will handle all the addresses that it needs to.  (*)

These are the addresses that rs6000_legitimate_address allows:
a) (reg)
b) (pre_{inc,dec} (reg))
c) (symbol_ref)
d) (const (plus (symbol_ref) (const_int)))
e) (plus (reg) (..))
f) (lo_sum (reg) (..))

(a) via legitimate_indirect_address_p, (c) and (d) via
legitimate_small_data_p, (e) via legitimate_constant_pool_address_p,
stack offsets, rs6000_legitimate_offset_address_p and
legitimate_indexed_address_p, (f) via legitimate_lo_sum_address_p.

*) With the possible exception of indexed addressing modes.  We test for
the base being used also as a destination reg, but what of the index
reg?  What prevents an index from also being used as a destination?
Oh, I see.  The other parts of the expression where
legitimate_indexed_address_p is called in rs6000_legitimate_address,
exclude modes that might need multiple regs.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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