[Bug tree-optimization/78327] -Walloca-large-than false positives due to bad range info for signed integers in [-TYPE_MAX + N, N]
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 11 22:43:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78327
Marc Glisse <glisse at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Already in the original dump, we can see that the comparisons are optimized to
different shapes:
- if ((signed char) ((unsigned char) n + 125) < 0)
+ if ((unsigned char) n + 125 > 126)
For the second one, VRP knows how to build an assert_expr and interpret the
consequences on n, while for the first one it doesn't. Since we turn nice
comparisons into the first shape, I guess we should teach VRP to recognize it.
More information about the Gcc-bugs
mailing list