This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Query with legitimate_constant_p
Dan Towner <dant@picochip.com> writes:
>> > Instead of doing that, use `n' constraints, and suitable predicates
>> > where appropriate, to prevent GCC generating symbol references as
>> > immediate operands where they won't work.
>
>That doesn't work though. Consider the following:
>
> reg0 := symbol_ref("s")
> reg1 := mem(reg0 + 2)
>
>Because the symbol_ref is a valid constant, gcc propagates the constant
>into the memory load:
>
> reg1 := mem(symbol_ref("s") + 2)
It won't do that if you deny that it is a LEGITIMATE_ADDRESS
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/