[LLVMbugs] [Bug 19858] New: i8 checked mul is wrong on x86

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 26 08:21:24 PDT 2014


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

            Bug ID: 19858
           Summary: i8 checked mul is wrong on x86
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: kfischer at college.harvard.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider the following code sample:

declare {i8, i1} @llvm.umul.with.overflow.i8(i8 %a, i8 %b)
define i8 @main(i32 %argc) {
top:
  %RHS = trunc i32 %argc to i8
  %umul = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 25, i8 %RHS)
  %ex = extractvalue { i8, i1 } %umul, 1
  br i1 %ex, label %L, label %L1

L:                                                ; preds = %top
  ret i8 %RHS

L1:                                               ; preds = %top
  %umul.value = extractvalue { i8, i1 } %umul, 0
  ret i8 %umul.value
}

Running this with `lli test.ll` gives a return value of 1 rather than 25 (i.e.
the overflow flag was set when it shouldn't have been.

-- 
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/20140526/1083d0d7/attachment.html>


More information about the llvm-bugs mailing list