https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58195
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note at -O1, GCC does not remove empty loops (via the agressive DCE) which is why this won't be optimized at -O1 for GCC. Anyways the original testcases are now fixed due to the RTL change though I keeping this open until I fix the issue on the gimple level for the loop case.