https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70245
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2016-03-15 Ever confirmed|0 |1 --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The difference between r227381 and r227382 on the testcase is: --- r227382-1.s1 2016-03-15 20:34:52.699640513 +0100 +++ r227382-1.s2 2016-03-15 20:35:05.278470114 +0100 @@ -116,7 +116,7 @@ _ZL3barP1BPi: movl 24(%esp), %edi movl %eax, 24(%esp) movl %edi, 12(%esp) - movl (%edx), %ecx + movl (%edi), %ecx movl %eax, (%esp) addl %edx, %ecx movl %ebp, 4(%esp) which is the load of g->d in d's arguments, %edi at this point isn't equal to g, while %edx is (you can see it a few insns later, g and f are not modified after assignment and aren't addressable, thus they have the same value, and so it is actually f + f->d, in the addition it is either correct %edx + (%edx), or incorrect %edx + (%edi) where %edi happens to point to 0 instead of the right 4.