Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11302 closed bug (duplicate)

GHC HEAD uses up all memory while compiling `genprimcode`

Reported by: hvr Owned by:
Priority: highest Milestone: 8.0.1
Component: Compiler Version: 7.11
Keywords: PatternMatchWarnings Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #11303 #11239 Differential Rev(s):
Wiki Page:


When attempting to self-bootstrap GHC HEAD I discovered that utils/genprimocode can't be compiled with GHC HEAD.

How to reproduce roughly:

$ cd utils/genprimcode
$ alex --ghc Lexer.x
$ happy --ghc Parser.y
$ ghc-7.11.20151226 --make Main
[1 of 5] Compiling ParserM          ( ParserM.hs, ParserM.o )
[2 of 5] Compiling Lexer            ( Lexer.hs, Lexer.o )
[3 of 5] Compiling Syntax           ( Syntax.hs, Syntax.o )
[4 of 5] Compiling Parser           ( Parser.hs, Parser.o )
[5 of 5] Compiling Main             ( Main.hs, Main.o )
...killed by OS due to running out-of-memory after using up >10GiB ram....

Change History (4)

comment:1 Changed 4 years ago by bgamari

Resolution: duplicate
Status: newclosed

This is a duplicate of #11303.

comment:2 Changed 4 years ago by heisenbug

Taking the hint from I added -fno-warn-overlapping-patterns -fno-warn-incomplete-patterns to the compilation recipe like this:

ghc -hisuf hi -osuf o -hcsuf hc -static -H64m -O0 -fasm -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/genprimopcode/. -iutils/genprimopcode/dist/build -iutils/genprimopcode/dist/build/autogen -Iutils/genprimopcode/dist/build -Iutils/genprimopcode/dist/build/autogen -optP-include -optPutils/genprimopcode/dist/build/autogen/cabal_macros.h -package-id array- -package-id base- -XHaskell2010 -no-user-package-db -rtsopts -odir utils/genprimopcode/dist/build -hidir utils/genprimopcode/dist/build -stubdir utils/genprimopcode/dist/build -c utils/genprimopcode/./Main.hs -o utils/genprimopcode/dist/build/Main.o -fno-full-guard-reasoning -fno-warn-overlapping-patterns -fno-warn-incomplete-patterns

And it correctly built a Main.o and (subsequently on make) a genprimopcode so that I could go on bootstrapping.

comment:3 Changed 4 years ago by heisenbug

comment:4 Changed 4 years ago by simonpj

Keywords: PatternMatchWarnings added
Note: See TracTickets for help on using tickets.