[Bug tree-optimization/83190] missing strlen optimization of the empty string
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 28 15:59:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83190
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The strlen pass doesn't track of all the string lengths though, that would be
prohibitive, at least with the current infrastructure (say char a[1000000] =
{}; just notes that strlen(a) is 0, not that strlen(a + 253) is also 0.
Generally, the entry for such a pointer is only created when such pointer is
constructed, and at that point it is too late to find the length from the
earlier initializer.
More information about the Gcc-bugs
mailing list