------- Comment #1 from rguenth at gcc dot gnu dot org 2006-05-24 13:36 ------- Not only loads:
int foo(int k, int b) { int j=0; int res; do { for (int n=0;n<3;++n); res = b+1; } while (++j<k); return res; } b+1 is not moved out of the outer loop. This looks like it would affect loop invariant motion in general for nested loops in case the invariants are computed after the inner loops. Is this how it is supposed to be? -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|load-PRE confused by control|PRE confused by control flow |flow | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27755