<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - X86: Signed Overflowing Multiplication incorrect codegen on 32-bit Windows"
   href="https://bugs.llvm.org/show_bug.cgi?id=40289">40289</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86: Signed Overflowing Multiplication incorrect codegen on 32-bit Windows
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 --
<a href="https://godbolt.org/z/xCkFO3">https://godbolt.org/z/xCkFO3</a> -- 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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>