[LLVMbugs] [Bug 4404] New: Incorrect X86 code for trivial LL assembly

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jun 16 22:39:32 PDT 2009


           Summary: Incorrect X86 code for trivial LL assembly
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: evan at fallingsnow.net
                CC: llvmbugs at cs.uiuc.edu

Given this C:

int load() {
  int* ptr = (int*)0xabcfed;
  return *ptr;

Generates LL (using llvm-gcc -emit-llvm -O2 -S -o scratch/load.ll

; ModuleID = 'scratch/load.c'
target datalayout =
target triple = "i386-apple-darwin9"

define i32 @load() nounwind  {
        load i32* inttoptr (i64 11259885 to i32*), align 4              ;
<i32>:0 [#uses=1]
        ret i32 %0

Generates this x86 (using llvm-as < scratch/load.ll | llc -march=x86):

        .align  4,0x90
        .globl  _load
LBB1_0: ## entry
        movl    11259885, %eax


This seems quite wrong. The x86 code contains no load from the address, just
the address itself left in %eax.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list