[patch] for PRs 27639 and 26719

Richard Guenther rguenther@suse.de
Sun Jun 25 11:59:00 GMT 2006


On Sun, 25 Jun 2006, Eric Botcazou wrote:

> > Uh, I would guess a safe answer from nowrap_type_p is false, so you
> > need to put some reasoning behind that (integer) types with a base
> > type do not wrap.
> 
> My understanding is that a value may wrap in the base type but never in the 
> subtype alone.

I you have f.i.

unsigned:3 a = 0;
a = a + 9;

you will get

a = (unsigned:3)((unsigned)a + 9);

which is basically wrapping.  Is the Ada situation different here?  Or
will we always ask nowrap_type_p for (unsigned)a and not a?  Or is this
exactly the problem that we do not?

So, eventually, nowrap_type_p should return nowrap_type_p (TREE_TYPE 
(type)) in your case?

> > Apart from that, you seem to rely on "optimization" (nowrap_type_p returning 
> > true) to avoid the bug?
> 
> Not sure it's an optimization.  But perhaps tweaking convert_affine_scev would 
> indeed be better.

Yes, somewhere there's a bug...  do you have a testcase, btw?

Thanks,
Richard.

--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs



More information about the Gcc-patches mailing list