[llvm-bugs] [Bug 28189] New: DSE miscompile with TBAA

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 18 15:45:08 PDT 2016


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

            Bug ID: 28189
           Summary: DSE miscompile with TBAA
           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

Artificial evil testcase:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int f(int* x, int *y) {
  *x = 10;
  int z = *y;
  *(float*)x = 1.0;
  return z;
}
int (*ff)(int*,int*) = f;
int main() {
  void* x = malloc(4);
  printf("%d\n", ff(x, x));
}

Should print 10; with clang -O2, prints 0.  Tested on x86-64 Linux with trunk
clang.

DSE is incorrectly ignoring the load when it eliminates the store.

-- 
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/20160618/cb00cd96/attachment.html>


More information about the llvm-bugs mailing list