This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fixing another missed optimization opportunity in VRP
On Sun, 2006-01-22 at 14:45 +0100, Laurent GUERBY wrote:
> FYI, this patch causes PR ada/25900.
I'm pretty sure this is just exposing a latent bug.
What I'm seeing is that we're trying to adjust a range uscing SCEV
information.
We get an initial value of 24 from SCEV, the problem is the range
for the underlying type is [-INF, 3]. Everything is downhill from
there.
The initial value is not the max value (it is in fact out of the range
of the type). So we create a new VR_RANGE [24, 3], which, of course is
totally bogus.
I'm pretty sure I know *how* my match exposed the latent bug, and it
may be the case that my patch could use further refinement (it adjusts
a range in a way that may not be particularly helpful). But ultimately
something is badly wrong in either SCEV or adjust_range_with_scev. I
don't know either hunk of code well enough to diagnose it.
jeff