[GHC] #16229: Dump-parsed-ast fails for very large Fractional number constants

GHC ghc-devs at haskell.org
Thu Jan 24 17:43:12 UTC 2019


#16229: Dump-parsed-ast fails for very large Fractional number constants
-------------------------------------+-------------------------------------
           Reporter:  alanz          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.10.1
          Component:  Compiler       |           Version:  8.6.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The existing test file `T15271.hs` has

 {{{#!hs
 main = do
   print 1e646457008
   print 1e646457009 -- T15271: This incorrectly printed 0.0
   print 1e1555550000 -- This is still infinity
   print 1e1000000000 -- T15271: This incorrectly printed 0.0
 }}}

 Trying to run `ghc --dump-parsed-ast` T15271.hs` fails, using up all
 available memory.

 When dumping the file in ghc-exacptrint, the start looks like this

 {{{
                        ({ tests/examples/ghc88-copied/T15271.hs:2:9-19 }
                         Just (Ann (DP (0,1)) [] [] [((G AnnVal),DP (0,0))]
 Nothing Nothing)
                         (HsOverLit
                          (NoExt)
                          (OverLit
                           (NoExt)
                           (HsFractional
                            (FL
                             (SourceText "1e646457008")
                             (False)
                             (:%
 (100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 .....
 }}}

 I am not sure if this is an actual problem, but it is worth noting.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16229>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list