"Pinski, Andrew" <andrew.pin...@caviumnetworks.com> writes: > This patch implements a simple mips_delegitimize_address for this and > some related cases.
The problem is that these: > +/* In the name of slightly smaller debug output, and to cater to > + general assembler lossage, recognize various UNSPEC sequences > + and turn them back into a direct symbol reference. */ > + > +static rtx > +mips_delegitimize_address (rtx orig_x) > +{ > + orig_x = delegitimize_mem_from_attrs (orig_x); > + > + /* Turn (PLUS:DI (XX) > + (CONST:DI (UNSPEC:DI [(A)] SYMBOL_64_LOW))) > + into A. */ > + /* Turn (PLUS:DI (XX) > + (CONST:DI (PLUS:DI (UNSPEC:DI [(A)] SYMBOL_64_LOW) > (const_int))) > + into (PLUS:DI A (const_int)). */ > + /* Turn (PLUS:DI (ASHIFT:DI (CONST:DI (UNSPEC:DI [(A)] SYMBOL_64_HIGH)) > (32) ) > + (XX)) > + into A. */ > + /* Turn (PLUS:DI (ASHIFT:DI (CONST:DI (PLUS:DI (UNSPEC:DI [(A)] > SYMBOL_64_HIGH) > + (const_int))) (32)) > + (XX)) > + into (PLUS:DI A (const_int)). */ aren't trustworthy on their own. The CONSTs are just fragments of addresses, and while the whole expression would typically reference A(+CONST_INT), it might instead reference A(+CONST_INT)+SOMETHING, with the SOMETHING typically being added before the final low part. We can't tell from looking at the CONST alone whether there's a non-constant offset or not. I think this is similar to: /* MEMs without MEM_OFFSETs may have been offset, so we can't just use their base addresses as equivalent. */ in the default hook. Richard