https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77280
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Comment on attachment 39467 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39467 source Pr has an undefined value the first time through the loop. --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Comment on attachment 39467 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39467 source Pr has an undefined value the first time through the loop. --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jorg Kewisch from comment #0) > The attached code works correctly when 1) the two lines > 45 unsigned int lx = sizeof(t); > 46 printf("lx %d\n", lx); > are removed or 2) the line > 44 int a=0; > is added. This kind of behaviour almost always means you have a bug that is sensitive to the exact layout of variables on the stack (as is the case here, where you are using the garbage value of pr). It's very unlikely to be a bug in the compiler.