[GHC] #5522: mc03 -O -fliberate-case -fspec-constr runs out of memory

GHC ghc-devs at haskell.org
Thu Nov 27 18:57:04 UTC 2014


#5522: mc03 -O -fliberate-case -fspec-constr runs out of memory
-------------------------------------+-------------------------------------
              Reporter:  btutt       |            Owner:  simonpj
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Compiler    |          Version:  7.3
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Compile-    |       Blocked By:
  time performance bug               |  Related Tickets:
             Test Case:  mc03        |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * difficulty:   => Unknown
 * os:  Windows => Unknown/Multiple
 * architecture:  x86 => Unknown/Multiple


Comment:

 The immediate issue here is fixed. Test `5522.hs` from comment:2 does not
 run out of memory anymore.

 The reason seems to be that HEAD now reduces ''monad'' comprehensions such
 as `[x0 + x1 | x0 <- [0], x1 <- [1]]` to just `[1]` at compile time, just
 as 7.8.3 and earlier already did with ''list'' comprehensions. Maybe the
 real bug is just covered up?

 This is the output of
 `ghc -fforce-recomp --make 5522.hs -O -fliberate-case -fspec-constr
 -ddump-simpl`:
 {{{
 ==================== Tidy Core ====================
 Result size of Tidy Core = {terms: 7, types: 5, coercions: 0}

 Foo.output1 :: Int
 [GblId,
  Caf=NoCafRefs,
  Str=DmdType m,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 Foo.output1 = GHC.Types.I# 450

 output :: [Int]
 [GblId,
  Caf=NoCafRefs,
  Str=DmdType m2,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 output = GHC.Types.: @ Int Foo.output1 (GHC.Types.[] @ Int)
 }}}

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


More information about the ghc-tickets mailing list