#4992: LLVM trashes registers for primitive calls
------------------------------+---------------------------------------------
Reporter: scpmw | Owner: davidterei@…
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (LLVM) | Version: 7.1
Resolution: invalid | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Linux
Blocking: | Architecture: x86_64 (amd64)
Failure: Runtime crash |
------------------------------+---------------------------------------------
Changes (by dterei):
* status: patch => closed
* resolution: => invalid
Comment:
Cool! I wouldn't say that not paying attention to live variables is
perfectly safe though. The native code generator as I understand also
relies on this saving and restoring of live registers to have already been
done in the Cmm representation. The only reason it didn't crash on the
same code I assume is that the code for the primitive call never touched
the live registers. Its perfectly legal for it to do so though, so there
are some cases with bigger primitive calls where it would fail for the
native code generator. LLVM failed earlier as the registers are trashed to
prevent code duplication and slowdown and as there was no save and restore
in the Cmm LLVM correctly used the actually live registers for
intermediate code in the function.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4992#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs