This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: basic VRP min/max range overflow question
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, sebastian dot pop at cri dot ensmp dot fr
- Date: 19 Jul 2005 19:38:29 +0200
- Subject: Re: basic VRP min/max range overflow question
- References: <BED9A4B3.A88B%schlie@comcast.net><Pine.LNX.4.61.0506181606220.24758@digraph.polyomino.org.uk><Pine.LNX.4.61.0506181606220.24758@digraph.polyomino.org.uk><42B48D43.2070100@adacore.com> <9Z96FTq1w-B@khms.westfalen.de><42B54D96.2050006@adacore.com><20050620132549.GA6005@napoca.cri.ensmp.fr><200506201809.j5KI9Vnp005082@greed.delorie.com><20050713080136.GB5882@napoca.cri.ensmp.fr><200507131517.j6DFHTeU028573@greed.delorie.com><20050718162241.GB22195@napoca.cri.ensmp.fr><m3wtnox9eu.fsf@uniton.integrable-solutions.net><42DCE4CE.1010000@lu.unisi.ch>
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:
| Gabriel Dos Reis wrote:
| > Sebastian Pop <sebastian.pop@cri.ensmp.fr> writes:
| > [...]
| > | +@item -Wloop-bound-estimated
| > | +@opindex Wloop-bound-estimated
| > | +Warn when an estimation of the number of iterations is computed based
| > | +on the fact that compiled programs are correct and do not invoke
| > | +undefined behavior.
| > I think the documentation would need to be less vague about the
| > precondition -- there are many sources of "undefined behaviour" :-)
|
| Also, I believe that we need an explanation of *why* one should be
| warned about this. Like
|
| Warn when a loop in the program may invoke undefined behavior (for
| example accessing past an element of the array). In this case, GCC
| optimizes the program assuming that the program is correct; otherwise
| the compiled code will be correct but suboptimal.
|
| I would name the flag -Wsafe-loop-optimizations
That makes sense to me.
-- Gaby