https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107476
Bug ID: 107476 Summary: Spurious stringop-overflow warning Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pkoning at gcc dot gnu.org Target Milestone: --- Created attachment 53803 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53803&action=edit Reproducer. Compile with -O3 The attached code produces a stringop-overflow warning complaining that the code is writing into offset 1 of a one entry array (ttix_buf, reference in ttix_svc). In fact it does not, since the index is the control variable in a for loop that ends on a < one check. Curiously, if I increase the size of the ttix_buf array, I still see the error at size 2 or 3, but no complaints at size 4 or above.