This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52560] if (r == -1) causes 'assuming signed overflow does not occur when simplifying conditional to constant'
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 13:22:32 +0000
- Subject: [Bug tree-optimization/52560] if (r == -1) causes 'assuming signed overflow does not occur when simplifying conditional to constant'
- Auto-submitted: auto-generated
- References: <bug-52560-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52560
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-12
Component|c |tree-optimization
Ever Confirmed|0 |1
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-12 13:22:32 UTC ---
It certainly inlines the function, does not figures out the loop does not run
and then computes n's value-range as is [0, +INF(OVF)] and thus when
simplifying
the return value comparison against -1 it says it assumes that n++ does not
wrap.
Looks ok to me, though it is all because of dead code and thus a missed
VRP of some sort.