https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35926
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Target Milestone|--- |5.0 Status|NEW |RESOLVED Known to work| |5.1.0 --- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Fixed in GCC 5+. I know comment #8 said it was fixed in GCC 4.8.0 but I could reproduce the missed optimization in released GCC 4.8.1 through 4.9.4.