------- Comment #2 from steven at gcc dot gnu dot org 2009-08-10 21:29 ------- Hmm, this isn't my day. Of course you're right, Andrew.
So the issue is that a loop invariant load is not hoisted at -Os, because it does not improve size. FWIW several patches have been proposed to change this, see e.g.: http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00199.html http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00794.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41026