https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96827
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Oddly enough with > gcc-10 --version gcc-10 (SUSE Linux) 10.2.1 20200805 [revision dda1e9d08434def88ed86557d08b23251332c5aa] Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I get your expected "6 4 2 0" at all optimization levels.