Created attachment 54071 [details] Reproducer Compiling with -O2 or higher I get an incorrect warning: test.c: In function ‘foo3’: test.c:15:5: warning: ‘foo’ accessing 16 bytes in a region of size 8 [-Wstringop-overflow=] This doesn't appear at lower optimization levels. It's also very sensative to the function, for example removing the return on the next line makes the warning go away.
This has been fixed on trunk and is likely a duplicate.
Dup. *** This bug has been marked as a duplicate of bug 104162 ***