Closed pkubaj closed 1 year ago
I confirmed this behavior with the system compiler on FreeBSD 14.0-CURRENT on amd64 and aarch64 as well. The ports build of llvm16 does not crash, despite being based on a very similar version of llvm.
LLVM in ports has assertions disabled, which is probably the reason.
LLVM in ports has assertions disabled, which is probably the reason.
I think you are right about that. I also reproduced the crash on amd64 Linux using a build with assertions enabled.
This regressed with 65cf77d218cf8b6aee2dbe252f5512cccc0311c8 by @spavloff (cc @rjmccall).
The reproducer provided here is not related to 65cf77d, because it causes compiler crash with that commit reverted.
The problem reported here is fixed by the patch https://reviews.llvm.org/D154359.
@llvm/issue-subscribers-clang-frontend
Would it be possible to merge it to 16?
@DimitryAndric Also, a backport to FreeBSD would be well appreciated :)
I think clang 17 is going to be branched soon, so 16 is a bit "old" already... In any case I have merged it into FreeBSD in freebsd/freebsd-src@1cd9788408aa9ea4fd0fbc3e06bd9a4eaf8d8d22.
The bad codegen reported in https://github.com/llvm/llvm-project/issues/63063#issuecomment-1572726311 still occurs with this fix.
@spavloff, I have opened a regression defect against the fix: https://github.com/llvm/llvm-project/issues/64605 @DimitryAndric, fyi, in case you want to revert this out of FreeBSD.
@llvm/issue-subscribers-clang-codegen
As I commented in https://github.com/llvm/llvm-project/issues/64605, this problem is not caused by https://github.com/llvm/llvm-project/commit/fde5924dcc69fe814085482df259b8cfee236f2c, and revert of this commit does not fix the issue.
I opened https://github.com/llvm/llvm-project/issues/64823 for a different case that hits the same assertion.
FreeBSD 14.0-CURRENT LLVM 16.0.6 powerpc64le, powerpc64, powerpc
Reproducer:
Build with:
Output: