Fix over-eager constant folding in bitInteger
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 22 Mar 2018 09:51:24 +0000 (09:51 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 22 Mar 2018 09:51:24 +0000 (09:51 +0000)
commitefc844f5b955385d69d8e20b80d38311083a6665
tree8db80f4b9ffb44e84ba14ef3a57d0d620edffbef
parent3446cee05e08d78033e141fa46d4de6929542cbb
Fix over-eager constant folding in bitInteger

The RULE for bitInteger was trying to constant-fold

    bitInteger 9223372036854775807#

which meant constructing a gigantic Integer at compile
time.  Very bad idea!  Easily fixed.

Fixes Trac #14959, #14962.
compiler/prelude/PrelRules.hs
testsuite/tests/simplCore/should_compile/T14959.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T