This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -funsafe-loop-optimizations
- From: Robert Dewar <dewar at adacore dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: David Edelsohn <dje at watson dot ibm dot com>,Daniel Berlin <dberlin at dberlin dot org>,Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, gcc at gcc dot gnu dot org
- Date: Sat, 01 Jan 2005 09:57:32 -0500
- Subject: Re: -funsafe-loop-optimizations
- References: <20041231211409.GA22814@atrey.karlin.mff.cuni.cz> <Pine.LNX.4.60.0412311649170.6844@dberlin.org> <20041231232501.GA16663@redhat.com> <200501010543.j015h3D33264@makai.watson.ibm.com> <20050101101152.GA17037@redhat.com>
Richard Henderson wrote:
And/or a -W option that warns for these sorts of loops so that
(a) we can see how often this happens, really, (b) so that users
can fix the presumed mistake.
Although warnings are desirable where easily given, I would say
that you have to be careful about this. If the warning can be
precise with no or few false positives, then presumably these
situations are rare, and you might as well compile correct code
for them.
If the warnings are imprecise, then false positives may be a real
problem. After all such an option gets installed because we think
it will have some useful effect on real programs. If this is the
case, then that translates into real programs generating false
positive warnings.
False positive warnings are quite a formidable enemy to quality,
because they encourage programmers to follow the evil practice
of turning off warnings or ignoring them (I am amazed how often
we get reports where there are clear significant warnings, but
no one pays attention to them).