https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91310
--- Comment #4 from Fritz Reese <foreese at gcc dot gnu.org> --- Created attachment 46651 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46651&action=edit intermediate code for test case 2 You can see the central loop described in the original report from lines 18-25. The bounds of the loop are problematic, as iterations 509-511 will overflow the source buffer. The optimized version is able to detect the overflow and issue a warning.