[llvm-bugs] [Bug 40289] New: X86: Signed Overflowing Multiplication incorrect codegen on 32-bit Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 10 17:55:35 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40289

            Bug ID: 40289
           Summary: X86: Signed Overflowing Multiplication incorrect
                    codegen on 32-bit Windows
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

First reported to use at rust-lang/rust it looks like a regression has happened
somewhere between 7.0.0 and the current trunk. Taking a look at godbolt --
https://godbolt.org/z/xCkFO3 -- the following IR:



target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc"

define fastcc { i64, i1 } @testit(i64 %self) {
start:
  %0 = tail call { i64, i1 } @llvm.smul.with.overflow.i64(i64 %self, i64 4)
  ret { i64, i1 } %0
}

; Function Attrs: nounwind readnone speculatable
declare { i64, i1 } @llvm.smul.with.overflow.i64(i64, i64) #2





when compiled will `popl %esp` on trunk, but on 7.0.0 it correctly executes
`add $4, %esp`. Some local bisection using `-opt-bisect-limit` shows that this
happens during the "X86 Optimize Call Frame on function" pass.

-- 
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/20190111/11e013ed/attachment.html>


More information about the llvm-bugs mailing list