This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic VRP min/max range overflow question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]