[llvm-bugs] [Bug 46156] New: [Dead Store Elimination + MemSSA] wrong code

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 1 07:15:41 PDT 2020


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

            Bug ID: 46156
           Summary: [Dead Store Elimination + MemSSA]  wrong code
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23560
  --> https://bugs.llvm.org/attachment.cgi?id=23560&action=edit
reduced testcase

The reduced program (also attached) should print '1', but with these options:

clang -O3 -march=z13 ./tc_wrong_dse_memssa.i -o a.out -w -mllvm
-enable-dse-memoryssa -mllvm -unroll-full-max-count=1; 

, it prints '0'.


int a = 0, e = 0;
int b = 0;
short c[2] = {0, 0};
int *a_ptr = &a;
int main() {
  c[0] = 1;
  for (b = 1; b >= 0; b--)
    e = *a_ptr = c[b];
  c[0] = 0;
  printf("checksum = %X\n", a);
}

-- 
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/20200601/139982db/attachment.html>


More information about the llvm-bugs mailing list