This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc silently transforms a finite loop to an infinite one
- From: Robert Dewar <dewar at adacore dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Nadezhda IvanÐvna Vyukova <niva at niisi dot msk dot ru>, gcc at gnu dot org, gcc-help at gnu dot org
- Date: Tue, 29 Nov 2011 09:03:25 -0500
- Subject: Re: Gcc silently transforms a finite loop to an infinite one
- References: <1322566691.2994.43.camel@ab02> <Pine.LNX.4.64.1111291426550.26507@wotan.suse.de>
On 11/29/2011 8:29 AM, Michael Matz wrote:
IMHO it would be better to issue a warning when a finite loop is
transformed to an infinite one (as a result of -ftree-vrp).
-Wstrict-overflow gives a warning in this program. This warning isn't
active by default. 4.1 didn't yet have this warning IIRC.
I would tend to agree that when this transformation is applied, an
unconditional warning is appropriate. It's almost certainly indicative
of a bug, and indeed the character case of this report is such a common
case that I would look for it specifically and diagnose it (and
preferably make it "work").
Ciao,
Michael.