[Bug tree-optimization/63989] tree-ssa-strlen.c doesn't handle constant pointer plus and array refs if constant offset is smaller than known constant string length
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 27 23:39:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63989
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
Blocks| |83819
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
In three out of the four test cases in comment #1 the strlen call is eliminated
(GCC 8 and 9). The only one remaining is f3():
f3 (char * p)
{
char * _1;
long unsigned int _2;
int _7;
<bb 2> [local count: 1073741825]:
__builtin_memcpy (p_4(D), "foobar", 7);
MEM[(char *)p_4(D) + 2B] = 0;
_1 = p_4(D) + 3;
_2 = __builtin_strlen (_1);
_7 = (int) _2;
return _7;
}
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819
[Bug 83819] [meta-bug] missing strlen optimizations
More information about the Gcc-bugs
mailing list