Issue 71312
Summary SIGILL with new libc qsort_r implementation in BranchFolder::MergePotentialsElt
Labels libc
Assignees
Reporter crrodriguez
    https://github.com/llvm/llvm-project/blob/7c1ad51e018c5a1517ca6fb58a4d7027a8bec64e/llvm/lib/CodeGen/BranchFolding.cpp#L491

Now glibc compares an object with itself, just like when _GLIBCXX_DEBUG is enabled therefore explicit unreachable triggers.  this breaks at least any rustc compiler available.

```
#0  0x000015129e40516a in int llvm::array_pod_sort_comparator<llvm::BranchFolder::MergePotentialsElt>(void const*, void const*) () from /home/crrodriguez/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/[libLLVM-17-rust-1.75.0-nightly.so](http://libllvm-17-rust-1.75.0-nightly.so/)

#1 0x00001512a0043779 in __GI___qsort_r (pbase=0x15128c90bd80, total_elems=<optimized out>, size=0x10, cmp=<optimized out>, arg=<optimized out>) at qsort.c:335

#2  0x000015129e4df6e6 in llvm::BranchFolder::TryTailMergeBlocks(llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, unsigned int) () from /home/crrodriguez/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/[libLLVM-17-rust-1.75.0-nightly.so](http://libllvm-17-rust-1.75.0-nightly.so/)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to