[Bug middle-end/92308] Gimple passes could do a better job of forming address CSEs

rearnsha at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 4 13:44:00 GMT 2019


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

--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #5)
> On Mon, 4 Nov 2019, rearnsha at gcc dot gnu.org wrote:

> I suspect TARGET_LEGITIMIZE_ADDRESS is only applied during
> reload/LRA, correct?

No, it's called during expand if the address isn't valid.  But it's called in
isolation with no information about what other addresses might be generated, so
forming bases is guesswork based purely on heuristics.

There's a similar hook in LRA (TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT), but it
has the same basic problem that the B/E doesn't know what other values might
need legitimizing.


More information about the Gcc-bugs mailing list