-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Description
Compiling the following Haskell from the Happy test suite using GHC 9.0.2: issue93.a.hs.gz
using the command line: ghc -fllvm -Wall -Werror -fforce-recomp issue93.a.hs -o issue93.a.bin
generates the following IR: ghc_4.ll.gz
GHC then invokes opt
, with the following command line: opt -mem2reg -globalopt -lower-expect -enable-tbaa -tbaa -relocation-model=pic ghc_4.ll -o ghc_6.bc
which crashes when processing the IR with the following traceback: 3TTJHXQYK.txt
Tested using opt
from LLVM 13.0.1, 14.0.6, and git master, on amd64, arm64, and ppc64le. Same traceback on all versions and arches. The specific traceback above is from git master. Fully reproducible from what I can tell.
I tried to minimize the IR, first using bugpoint
. Unfortunately bugpoint
itself segfaults, with the exact same traceback as opt
. I then tried using llvm-reduce
, but it also segfaults after three passes, and the slightly reduced IR it leaves behind is not valid, and can't be processed by opt
.