https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113012
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2023-12-14
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
typedef __SIZE_TYPE__ size_t;
extern void *reallocarray(void *__ptr, size_t __nmemb, size_t __size)
__attribute__((__alloc_size__(2, 3)));
void miZeroLine(int npt, int Nspans, int list_len, int ady) {
int *pwidthInit, *widths;
pwidthInit = reallocarray(0, (list_len), (sizeof(int)));
widths = pwidthInit - 1;
while (--npt > 0)
{
if (ady + 1 > Nspans)
widths = pwidthInit - 1;
++*widths;
++widths;
}
}
```
Note I am not 100% sure the above code is well defined due to subtracting one
from the allocated array.