diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2021-09-10 09:58:20 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-11 08:58:04 -0400 |
commit | 2d15175266d0e0d9ca6565124b0c17e207b5541c (patch) | |
tree | f3143ca1463d7b169851f510dd05ccdb60e69ad5 /libraries | |
parent | 070ae69c0c8cee2b778907805134d327964a0c0f (diff) | |
download | haskell-2d15175266d0e0d9ca6565124b0c17e207b5541c.tar.gz |
Break recursion in GHC.Float.roundingMode# (#20352)
Judging from the Assumption, we should never call `roundingMode#` on a negative
number. Yet the strange "dummy" conversion from `IN` to `IP` and the following
recursive call where making the function recursive.
Replacing the call by a panic makes `roundingMode#` non-recursive, so that we
may be able to inline it.
Fixes #20352.
It seems we trigger #19414 on some jobs, hence
Metric Decrease:
T12545
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/GHC/Float.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/base/GHC/Float.hs b/libraries/base/GHC/Float.hs index 743da55df8..2fb30c5712 100644 --- a/libraries/base/GHC/Float.hs +++ b/libraries/base/GHC/Float.hs @@ -1293,7 +1293,7 @@ roundingMode# (IS i#) t = then 2# else 1# -roundingMode# (IN bn) t = roundingMode# (IP bn) t -- dummy +roundingMode# (IN _) _ = errorWithoutStackTrace "roundingMode#: IN" -- See the Assumption roundingMode# (IP bn) t = let j = word2Int# (int2Word# t `and#` MMASK##) -- index of relevant bit in word |