https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98552
--- Comment #3 from Tobias Schlüter <tobi at gcc dot gnu.org> --- Don't ask how long I'd been staring at the assembly in disbelief until I figured out what had gone wrong :-) In this particular case the problem can be addressed by passing &j into the function instead of &i, so I wonder why the Fortran f.e. can't do that? One possible problem is that if j's address escapes (in the sense that the compiler assumes that subsequent function calls can do whatever to it), you'd need a new fake memory location.