Open q66 opened 9 months ago
@llvm/issue-subscribers-backend-powerpc
Author: q66 (q66)
I have also verified this on Alpine Linux. The test program does not need recompiling; simply replacing the libunwind shared library is enough to reproduce it (a non-LTO binary still works everywhere, though, regardless of the libunwind build). There is a good chance it's reproducible on glibc distros as well, but I haven't had a chance to verify this yet.
Clang 17.0.6, ppc64le, musl libc, compiler-rt/libunwind/libc++, Chimera Linux.
Given the following program C++:
I get the following output:
When compiled with the following flags:
-O2 -flto=thin
, but particularly only when libunwind is compiled with-ftrivial-auto-var-init=zero
. The prerequisite is always this combo; if I either compile the test program without LTO, or if I compile libunwind without any special flags, the test program works. It's always the second iteration that breaks. I am not sure whether this is a miscompilation problem of the test program, or of libunwind itself.This was originally found by running the test suite of the
fmt
library, where theostream
tests fail like this. It's always every second throw, i.e. in a program with 4 iterations, two of them fail.Other architectures seem to work okay in all cases.