This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/63184] [7/8/9 Regression] Fails to simplify comparison
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Dec 2018 10:26:50 +0000
- Subject: [Bug middle-end/63184] [7/8/9 Regression] Fails to simplify comparison
- Auto-submitted: auto-generated
- References: <bug-63184-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63184
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Now to answer Jeff my original idea was to change how VN handles addresses
to use tree-affine in there. But that takes some time...
Given that we lower non-invariant addresses now another idea would be to
recognize
_4 = _3 + 4;
_5 = &a[1] + _4;
and reassociate that to combine the + 4 with the &a[1] (which is &a + 4).
Now the reassoc pass associates the constant last which makes this
unreliable to detect in a match.pd pattern (the constant may be far away)
but the reassoc pass itself could, when associating a chain, look for
whether the SSA name we start from is (single-)used in a POINTER_PLUS_EXPR
and the constant element in the reassoc ops[] array can be combined with
a constant offset in the address operand.
I'll see if that works out.