This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53265] Warn when undefined behavior implies smaller iteration count
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Apr 2013 06:07:23 +0000
- Subject: [Bug tree-optimization/53265] Warn when undefined behavior implies smaller iteration count
- Auto-submitted: auto-generated
- References: <bug-53265-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53265
--- Comment #28 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-30 06:07:23 UTC ---
The warning is only printed if the loop has a single exit and known constant
iteration count without the undefined behavior analysis, and when the warning
is printed, we don't apply the aggressive analysis anyway.
It is hard to warn in all cases, but what exactly would be the cases anyway,
the amount of surprise on undefined behavior varies a lot.
The point of the warning was to warn about the easy cases, for the rest applies
what we write in bugs.html - if a suspicious program behaviour goes away with
-fno-aggressive-loop-optimizations, most likely it is a fault of the compiled
code, not the compiler.