This is the mail archive of the
mailing list for the GCC project.
Re: Query with legitimate_constant_p
Dan Towner <email@example.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