[llvm-commits] [llvm] r60608 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86Subtarget.cpp lib/Transforms/Scalar/LoopStrengthReduce.cpp test/CodeGen/X86/loop-strength-reduce-2.ll test/CodeGen/X86/loop-strength-reduce-3.ll test/CodeGen/X86/loop-strength-reduce.ll

Anton Korobeynikov anton at korobeynikov.info
Fri Dec 5 14:38:10 PST 2008


Hi, Dale

>
> 	movl	$4, A at GOT+4(%edx,%eax,4)
Assembler ate this without any problems... But I don't see usage of  
GOT register here and don't think this is valid, since you're patching  
address inside GOT.

If A is array, you need to do load first to obtain it's address, e.g.  
this code:
int A[10];

int foo() {
   return A[5];
}

compiles into (here ecx is GOT register):

         movl    A at GOT(%ecx), %eax
         movl    20(%eax), %eax


> (or A+4 at GOT) valid on Linux?
This should be invalid.

---
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081206/a81e12d9/attachment.html>


More information about the llvm-commits mailing list