This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Keep lattice abstract in the SSA propagator, substitue lattice values at defs
On Sun, 8 Aug 2010, Eric Botcazou wrote:
> > D.2544_253 = prephitmp.53_302 + 2147483647;
> > D.2553_254 = (size_type) D.2544_253;
>
> The signed integer overflow is introduced during the reassoc1 pass. For the
> attached reduced testcase, we start from:
>
> <bb 45>:
> D.2615_217 = L43b_216 + -1;
> iftmp.30_218 = D.2615_217 + -2147483648;
> D.2624_225 = (size_type) iftmp.30_218;
>
> and we go to:
>
> <bb 45>:
> iftmp.30_218 = L43b_216 + 2147483647;
> D.2624_225 = (size_type) iftmp.30_218;
Well, I remember a similar kind of problem fixed in fold - basically
you can't re-associate (a + b) + c to a + (b + c) with signed
arithmetic. But - we can do so if reassociating constants only
as in the example above. Because if (L43b_216 - 1) - 2147483648
doesn't overflow then L43b_216 + 2147483647 doesn't either.
So I believe this specific problem pre-exists before re-assoc.
Richard.