[Bug tree-optimization/83693] missing strlen optimization for array of arrays
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 4 23:15:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83693
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Here's another test case with structs.
const struct {
char a[4];
} a[] = { { "0" }, { "01" } };
const struct {
char a[5];
} b[][2] = { { { "0" }, { "01" } }, { { "012" }, { "0123" } } };
void f (void)
{
if (__builtin_strlen (a[1].a) != 2)
__builtin_abort ();
}
void g (void)
{
if (__builtin_strlen (b[1][1].a) != 4)
__builtin_abort ();
}
More information about the Gcc-bugs
mailing list