diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-29 04:22:35 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-29 04:22:35 +0000 |
commit | efdfb1e6b2bc8dc9348fe137aaa57bf2fe5ebd7c (patch) | |
tree | 33a2a6da963e925db2c985d12c2e74e6c9405f8d /llvm/test/CodeGen/X86/tls-pie.ll | |
parent | 8c9e6728b35fa459b25d5cce05b54f41e8f35cfe (diff) | |
download | bcm5719-llvm-efdfb1e6b2bc8dc9348fe137aaa57bf2fe5ebd7c.tar.gz bcm5719-llvm-efdfb1e6b2bc8dc9348fe137aaa57bf2fe5ebd7c.zip |
In the initial exec mode we always do a load to find the address of a variable.
Before this patch in pic 32 bit code we would add the global base register
and not load from that address. This is a really old bug, but before the
introduction of the tls attributes we would never select initial exec for
pic code.
llvm-svn: 159409
Diffstat (limited to 'llvm/test/CodeGen/X86/tls-pie.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/tls-pie.ll | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/tls-pie.ll b/llvm/test/CodeGen/X86/tls-pie.ll index 5cb3866f71c..8269c43b9a7 100644 --- a/llvm/test/CodeGen/X86/tls-pie.ll +++ b/llvm/test/CodeGen/X86/tls-pie.ll @@ -40,7 +40,8 @@ define i32 @f3() { ; X32-NEXT: popl %eax ; X32-NEXT: .Ltmp{{[0-9]+}}: ; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax -; X32-NEXT: movl %gs:i2@GOTNTPOFF(%eax), %eax +; X32-NEXT: movl i2@GOTNTPOFF(%eax), %eax +; X32-NEXT: movl %gs:(%eax), %eax ; X32-NEXT: ret ; X64: f3: ; X64: movq i2@GOTTPOFF(%rip), %rax @@ -56,11 +57,11 @@ define i32* @f4() { ; X32: f4: ; X32: calll .L{{[0-9]+}}$pb ; X32-NEXT: .L{{[0-9]+}}$pb: -; X32-NEXT: popl %eax +; X32-NEXT: popl %ecx ; X32-NEXT: .Ltmp{{[0-9]+}}: -; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax -; X32-NEXT: leal i2@GOTNTPOFF(%eax), %eax -; X32-NEXT: addl %gs:0, %eax +; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %ecx +; X32-NEXT: movl %gs:0, %eax +; X32-NEXT: addl i2@GOTNTPOFF(%ecx), %eax ; X32-NEXT: ret ; X64: f4: ; X64: movq %fs:0, %rax |