Martin, are you saying this bug should still be open?
Comment #5 by code — 2013-03-15T13:48:10Z
(In reply to comment #4)
> Martin, are you saying this bug should still be open?
No, the bug is fixed but it's terribly inefficient when the GOT isn't cached.
What happens now is that the optimizer kills the unreferenced localgot variable and instead the GOT address is loaded anew for every access.
Comment #6 by code — 2013-03-15T14:25:05Z
A slightly different case of the bug that still happens.
I haven't had time to reduce it yet though.
--------------------
dmd -c -m32 -fPIC -O druntime/src/core/runtime.d
--------------------
runModuleUnitTests PROC NEAR
push ebp ; 0000 _ 55
mov ebp, esp ; 0001 _ 8B. EC
sub esp, 436 ; 0003 _ 81. EC, 000001B4
push ebx ; 0009 _ 53
mov ecx, 35 ; 000A _ B9, 00000023
xor eax, eax ; 000F _ 31. C0
push esi ; 0011 _ 56
push edi ; 0012 _ 57
lea edi, [ebp-1B4H] ; 0013 _ 8D. BD, FFFFFE4C
rep stosd ; 0019 _ F3: AB
lea ecx, [ebp-1B0H] ; 001B _ 8D. 8D, FFFFFE50
push ecx ; 0021 _ 51
mov ebx, dword ptr [ebp-4H] ; 0022 _ 8B. 5D, FC
call sigfillset ; 0025 _ E8, FFFFFFFC(PLT r)
...
The instruction that loads the GOT address from the stack is there but the part that stores it on the stack has been optimized away.
Comment #7 by github-bugzilla — 2013-03-15T14:40:24Z