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

            Bug ID: 44913
           Summary: Missing DSE opportunity when second store is done in
                    inline assembly
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: gli...@google.com
                CC: florian_h...@apple.com, llvm-bugs@lists.llvm.org,
                    llvm-bugzi...@jfbastien.com, vitalyb...@google.com

As reported by Daniel Colascione, Clang fails to remove the dead store in the
following program:

 extern int foo(int* bar);

 int bar()
 {
    int x = 5;
    asm("nop\n\tnop\n\tnop" : "=m" (x));
    return foo(&x);
 }


see https://gcc.godbolt.org/z/c2fMNH (bad, clang) vs.
https://gcc.godbolt.org/z/a_biz5 (good, GCC).

This probably prevents it from deleting redundant initialization before
copy_from_user() in the Linux kernel.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to