// 2011 Oct 19; Moc OS X 10.7.2 // Apple bug #10311664 // gcc grb.c -O1 -Wall //#include int main(){ double to[5]; double *u = &to[4]; int j = 5; while (j-- >= 1) (u--)[0] += 42; // {int j; for(j=0; j<5; ++j) printf("%e\n", to[j]);} return to[1];} // Returns 0; should return 42; witness clang. /* (gdb) disass main Dump of assembler code for function main: 0x0000000100000f00 : push %rbp 0x0000000100000f01 : mov %rsp,%rbp 0x0000000100000f04 : movq $0x0,-0x20(%rbp) 0x0000000100000f0c : mov $0x50,%eax 0x0000000100000f11 : movsd 0x47(%rip),%xmm0 # 0x100000f60 0x0000000100000f19 : nopl 0x0(%rax) 0x0000000100000f20 : movsd -0x58(%rbp,%rax,1),%xmm1 0x0000000100000f26 : addsd %xmm0,%xmm1 0x0000000100000f2a : movsd %xmm1,-0x58(%rbp,%rax,1) 0x0000000100000f30 : add $0xfffffffffffffff0,%rax 0x0000000100000f34 : jne 0x100000f20 0x0000000100000f36 : cvttsd2si -0x20(%rbp),%eax 0x0000000100000f3b : pop %rbp 0x0000000100000f3c : retq End of assembler dump. Note address increment of -16 at 0x100000f30 gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) */