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

            Bug ID: 50147
           Summary: missing mflr/mtlr (link register save/restore) when
                    using inline asm w/ "lr" clobber
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedb...@nondot.org
          Reporter: ndesaulni...@google.com
                CC: llvm-bugs@lists.llvm.org, natechancel...@gmail.com,
                    nemanja.i....@gmail.com, srhi...@google.com,
                    ulrich.weig...@de.ibm.com, uweig...@de.ibm.com
            Blocks: 4068

example:
void foo (void) {
    asm ("":::"lr");
}

powerpc64le-linux-gnu-gcc -O2:
foo:
        mflr 0
        std 0,16(1)
        ld 0,16(1)
        mtlr 0
        blr

clang --target=powerpc64le-linux-gnu -O2:
foo:
        blr

This is causing ppc32 Linux kernels to hang when powering down, resulting in CI
failures, as reported by Nathan Chancellor and debugged by Christophe Leroy in
https://lists.ozlabs.org/pipermail/linuxppc-dev/2021-April/228246.html.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
-- 
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