bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."


From: Richard Kenner
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Mon, 01 Jan 2007 22:21:21 EST

> VRP as currently written adjust limits out to "infinity" of an
> appropriate sign for variables which are changed in loops.  It then
> assumes that the (signed) variable will not wrap past that point,
> since that would constitute undefined signed overflow.

But isn't that fine since OTHER code is going to assume that loop invariants
don't overflow?  Or is it that we'd have to refine VRP's test to only do it
in that case?

>   for (i = 1; i < m; ++i)
>     {
>       if (i > 0)
>       bar ();
>     }

Of course, this is an example where either the programmer is doing something
very silly or else is expecting overflow and depending on wrap semantics, so
it seems to me marginal to remove that "if".  My suggestion would be to issue
a warning saying that the test will never be false, but leaving it in.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]