Address rejected by TARGET_LEGITIMATE_ADDRESS_P recreated in post reload CSE pass at -O2

Ayonam Ray ayonam@gmail.com
Mon May 21 19:14:00 GMT 2012


Hi,

I have an address (symbolicRef + indexReg * scaleFactor) that is
rejected by my TARGET_LEGITIMATE_ADDRESS_P.  However, at -O2, the same
address gets recreated in the post reload CSE pass.  The symbolic
reference just after the reload is in a register and the address
"register + indexReg * scaleFactor" is a valid address for my
architecture.  The CSE figures out that the symbolic reference is in a
register (the notes say so) and replaces the "register + indexReg *
scaleFactor" address with "symbolicRef + indexReg * scaleFactor".

Is there a way to prevent this from happening?  Am I missing some
target definitions which is causing this?  Or is it an incorrect
predicate definition?

I get the failure in "movsi" when, after the post reload CSE, it tries
to match the constraints for that memory operand.  The 'm' constraint
ends up calling the TARGET_LEGITIMATE_ADDRESS_P which returns a zero
and the constraint check fails.

Thanks in advance.
Regards
Ayonam



More information about the Gcc-help mailing list