https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123160
--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
to be concise, the following testcase has no memset:
struct A
{
char a[10];
char c[10];
} a;
int
main (void)
{
void *r = &a.a[4] + 2;
if (__builtin_object_size (r, 3) != sizeof (a.a) - 6)
__builtin_abort ();
}
folds to
int main ()
{
<bb 2> [count: 0]:
__builtin_abort ();
}
It seems we just need to fold pointer_plus a little smarter
