Bug 108074

Summary: [11/12 Regression] Incorrect stringop-overflow warning
Product: gcc Reporter: Alastair Irving <alastair.j.irving>
Component: tree-optimizationAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: marxin, rguenth
Priority: P3 Keywords: diagnostic, needs-bisection
Version: 12.2.0   
Target Milestone: 11.4   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 88443    
Attachments: Reproducer

Description Alastair Irving 2022-12-12 12:37:51 UTC
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.
Comment 1 Richard Biener 2022-12-12 12:57:04 UTC
This has been fixed on trunk and is likely a duplicate.
Comment 2 Martin Liška 2022-12-12 13:32:12 UTC
Dup.

*** This bug has been marked as a duplicate of bug 104162 ***