This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/52316] Loops not optimized away, though result is not used
- 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: Mon, 20 Feb 2012 15:07:27 +0000
- Subject: [Bug middle-end/52316] Loops not optimized away, though result is not used
- Auto-submitted: auto-generated
- References: <bug-52316-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52316
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-20 15:07:27 UTC ---
Is it sufficiently common to do something that insane though?
We optimize away the dead code in there of course, but the problem is that it
uses a floating point iterator. I guess our number of iterations analysis just
gives up when the IV is floating, here for known compile time constant init
value and condition operand if both values are sufficiently small we could
compute the number of iterations anyway, but as soon as adding 1 to a floating
point value doesn't change it, for IEEE single when the value is 16777216.0f,
you end up with an endless loop, and that should be honored even for -Ofast.