https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64025

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #2)
> This breaks because find_base_term is confused by what ix86_find_base_term
> (which calls ix86_delegitimize_address) returns, namely the
> (something - symbol_ref ("_GLOBAL_OFFSET_TABLE_")) + (const ((symbol_ref
> ("p") + const_int))
> as find_base_term considers only one symbol for its purposes.
> So, either we change ix86_find_base_term, so that it hides the (something -
> symbol_ref ("_GLOBAL_OFFSET_TABLE_")) part - often it stands for 0,
> as something is often just VALUE of the pic register or say pic register
> plus some variable offset and just returns the other part, or
> swap the order of the PLUS operands, so that the (const ...) part comes
> first and thus find_base_term first recurses on that, or move
> ix86_delegitimize_address to ix86_delegitimize_address_1, call it from
> ix86_delegitimize_address with some bool flag allowing what it does now, and
> from ix86_find_base_term disallowing that.  Or change find_base_term, so
> that for PLUS/MINUS it always recurses into both arguments, and if both
> provide different bases, returns NULL (though, this change might be too
> expensive).
> Preferences?

I think that we should just swap the order of the PLUS operands and add some
comment on the expected form of the RTX.

Reply via email to