[llvm-bugs] [Bug 27849] New: Incorrect call slot optimization in memcpyopt with noalias

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 23 20:24:29 PDT 2016


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

            Bug ID: 27849
           Summary: Incorrect call slot optimization in memcpyopt with
                    noalias
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: eli.friedman at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Testcase:

#include <cstdlib>
bool b = true;
__attribute((noinline))
void bar(int* x) { *x = 10; if (b) throw 0; }
__attribute((noinline))
void foo(int& __restrict x) {
  int t;
  bar(&t);
  x = t;
}
int main() {
  int x = 1;
  try {
    foo(x);
  } catch (...) {}
  if (x != 1) abort();
}

Works correctly with gcc and clang -O0; aborts with clang -O2.

Call slot optimization is being too aggressive in memcpyopt.

-- 
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/20160524/48f9114c/attachment.html>


More information about the llvm-bugs mailing list