https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64715
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|rguenth at gcc dot gnu.org |unassigned at gcc dot
gnu.org
Status|ASSIGNED |NEW
Last reconfirmed|2015-01-21 00:00:00 |2025-2-11
CC| |rguenth at gcc dot gnu.org
--- Comment #34 from Richard Biener <rguenth at gcc dot gnu.org> ---
int
main ()
{
struct A { char buf1[9]; char buf2[1]; } a;
char *p = a.buf1;
char *q = p + 1;
char *r = q + 4;
char *t = r - 1;
strcpy (t, str1 + 5);
return 0;
}
CCP still produces
_12 = __builtin___strcpy_chk (&MEM <char[9]> [(void *)&a + 4B], _2, 5);
with the object sizes resolved with help of the early objsz pass as
_8 = __builtin_object_size (t_6, 1);
_11 = MIN_EXPR <_8, 5>;
I am not working on more magic as is already present though. We can't have
both the cake (optimize before objsz) and also eat it (very correct objsz).