[Bug tree-optimization/109175] error: 'void* __builtin_memset(void*, int, long unsigned int)' writing 4 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

2023-09-26 Thread malat at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109175 --- Comment #8 from Mathieu Malaterre --- (In reply to Andrew Pinski from comment #6) > Notice how there is no check for null on aq. Do you want to keep this one open or should we close it as invalid ?

[Bug tree-optimization/109175] error: 'void* __builtin_memset(void*, int, long unsigned int)' writing 4 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

2023-03-24 Thread jan.wassenberg at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109175 --- Comment #7 from Jan Wassenberg --- Thanks, I will be changing the code to add a nullptr check.

[Bug tree-optimization/109175] error: 'void* __builtin_memset(void*, int, long unsigned int)' writing 4 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

2023-03-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109175 --- Comment #6 from Andrew Pinski --- Reduced all the way removing all of the classes showing exactly what I thought it was: ``` void *ao(); float *aq(long t) { if (t) return nullptr; return static_cast(ao()); } float v; void at(long t)

[Bug tree-optimization/109175] error: 'void* __builtin_memset(void*, int, long unsigned int)' writing 4 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

2023-03-24 Thread malat at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109175 --- Comment #5 from Mathieu Malaterre --- c-reduce(d) ugly version: % cat demo3.cc struct d { using b = float &; }; template using c = d::b; struct e { using b = c; }; template struct j; template using h = typename j::b; template

[Bug tree-optimization/109175] error: 'void* __builtin_memset(void*, int, long unsigned int)' writing 4 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

2023-03-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109175 --- Comment #4 from Andrew Pinski --- auto in = AllocateAligned(padded); The pointer returned here could be a nullptr The warning is due to jump threading though. AllocateAligned calls AllocateAlignedItems Which could return