[Bug tree-optimization/53265] Warn when undefined behavior implies smaller iteration count

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 11 15:49:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53265

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-11 15:49:00 UTC ---
Created attachment 29637
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29637
gcc48-pr53265.patch

Untested patch.  Not sure about the warning wording, plus no idea how to call
the warning option (-Wnum-loop-iterations, -Wundefined-behavior-in-loop,
something else?), whether to enable it by default, or just for -Wall.
A bigger issue is that I see multiple warnings for the same stmts, despite the
guard in loop structure, because apparently the same loop is represented by
different loop structures during the optimizations.



More information about the Gcc-bugs mailing list