Commit c45e2e29 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Fix compilation of `integer-gmp2` with `-O0`

At optimization level `-O0` `wordToInteger` wasn't inlined, and this caused a
`__integer` literal to turn up in final Core, which would trigger the GHC panic

  ghc-stage1: panic! (the 'impossible' happened)
    (GHC version 7.9.20141114 for x86_64-unknown-linux):
	Can't use Integer in integer-*

By forcing inlining via `inline` this is avoided.
This should hopefully address #9800.
parent 609cd28a
......@@ -660,9 +660,9 @@ quotRemInteger (Jn# n) (Jp# d) = case quotRemBigNat n d of
(# q, r #) -> (# bigNatToNegInteger q, bigNatToNegInteger r #)
quotRemInteger (Jp# n) (S# d#)
| isTrue# (d# >=# 0#) = case quotRemBigNatWord n (int2Word# d#) of
(# q, r# #) -> (# bigNatToInteger q, wordToInteger r# #)
(# q, r# #) -> (# bigNatToInteger q, inline wordToInteger r# #)
| True = case quotRemBigNatWord n (int2Word# (negateInt# d#)) of
(# q, r# #) -> (# bigNatToNegInteger q, wordToInteger r# #)
(# q, r# #) -> (# bigNatToNegInteger q, inline wordToInteger r# #)
quotRemInteger (Jn# n) (S# d#)
| isTrue# (d# >=# 0#) = case quotRemBigNatWord n (int2Word# d#) of
(# q, r# #) -> (# bigNatToNegInteger q, wordToNegInteger r# #)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment