https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86471
--- Comment #2 from Matt Bentley <mattreecebentley at gmail dot com> --- (In reply to Andrew Pinski from comment #1) > Does -O3 bring the performance back? -O3 enables loop distrubtion which > should be able to detect these loops. Just tested - yes. However this is a fairly trivial testcase and not all projects compile with O3 (most don't). Clang by comparison optimizes this out at -O2.