summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-11-15 18:05:58 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-15 18:11:17 +0100
commitc45e2e29dee8c38fc852388289d700605132278f (patch)
tree108d4b8cd29b2652e7479cf401c17818eada8551
parent609cd28a1a8616f4076088c87e443850d807ba7d (diff)
downloadhaskell-c45e2e29dee8c38fc852388289d700605132278f.tar.gz
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.
-rw-r--r--libraries/integer-gmp2/src/GHC/Integer/Type.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/integer-gmp2/src/GHC/Integer/Type.hs b/libraries/integer-gmp2/src/GHC/Integer/Type.hs
index 985d2ae0a7..a143160b6b 100644
--- a/libraries/integer-gmp2/src/GHC/Integer/Type.hs
+++ b/libraries/integer-gmp2/src/GHC/Integer/Type.hs
@@ -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# #)