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: Michael Matz <matz at suse dot de>
- To: Robert Dewar <dewar at adacore dot com>
- 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 15:55:09 +0100 (CET)
- 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> <4ED4E62D.3020102@adacore.com>
Hi,
On Tue, 29 Nov 2011, Robert Dewar 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,
Yes, well. The problem is, this particular warning is in fairly generic
code that triggers often in harmless situations, i.e. generates quite a
number false positives :-/
> 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.