
#8974: 64 bit windows executable built with ghc-7.9.20140405+LLVM segfaults ------------------------------------+---------------------------------- Reporter: awson | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.2 Component: Compiler (LLVM) | Version: 7.9 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ------------------------------------+---------------------------------- Comment (by awson): I've decided to investigate things further. After firing GDB I've seen a painfully familiar picture of what I saw at #8834. Looking into LLVM codegen code i see [http://git.haskell.org/ghc.git/blob/HEAD:/compiler/llvmGen/LlvmCodeGen/CodeG... ... For Caller save registers across C calls the saving and restoring of them is done by the Cmm code generator, using Cmm local vars. So to stop LLVM saving them as well (and saving all of them since it thinks they're always live, we trash them just before the call by assigning the 'undef' value to them. The ones we need are restored from the Cmm local var and the ones we don't need are fine to be trashed.] But recent #8834 saga teach us that after [http://git.haskell.org/ghc.git/blobdiff/66aa489fcbfca30dc3c3b553fce4f1e4debf...] this already is not the case. And after this [http://git.haskell.org/ghc.git/commitdiff/c4eeacdfdf4578eb6e75bbf2e067bfe70e... NCG became responsible for saving registers across the C call]. It looks LLVM backend still does not take this into account. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8974#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler