[LLVMbugs] [Bug 16105] New: Incorrect assembly around 'div' instruction on x86-64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 22 03:36:17 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16105

            Bug ID: 16105
           Summary: Incorrect assembly around 'div' instruction on x86-64
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: andrew.macp at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

In LLVM 3.3 from subversion (currently rev 182439) passing the following IR
into "lli -O0" prints an invalid character, whereas with -O1 or above or with
any opt level in LLVM 3.2 the number '9' is correctly output (followed by some
junk):

define void @main() {
entry:
  %a = call i8* @malloc(i32 2)
  %acast = bitcast i8* %a to [0 x i8]*
  %elemptr = getelementptr inbounds [0 x i8]* %acast, i32 0, i32 0

  ; input is here (9)
  %y = urem i8 9, 10

  %z = add i8 48, %y
  store i8 %z, i8* %elemptr

  call void @printf(i8* %elemptr)
  ret void
}

declare void @printf(i8*)
declare i8* @malloc(i32)

Dumping the assembly using "llc -O0" (3.3) and then passing that assembly to
gcc results in the following error:

file.s:22: Error: can't encode register '%ah' in an instruction requiring REX
prefix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130522/29e2bee4/attachment.html>


More information about the llvm-bugs mailing list