https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104789
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, | |missed-optimization --- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- I think the -Wstringop-overflow warnings are prone to false positives with loop unrolling just like the -Warray-bound warnings were which is why those were moved to before loop optimizations. Now all of those cases will re-appear as -Wstringop-overflow which happens too late since the strlen pass runs quite late. Unrolling sometimes "speculatively" peels iterations that will be never reachable at runtime and that we have difficulty to statically remove. That's simply hard to avoid. For GCC 13 we might want to experiment with moving the strlen pass before loop optimizations. I'd put it somewhere inbetween PRE and the DOM preceeding it.