Hello again,

I'm trying to compile a module that looks like this:

---begin
module PLib where
import Common
gr_lib = <the most collosal constant in the world, ever>
---end

GHC comes up with:

"PLib.hs", line 3, column 476908: parser stack overflow on input: ""i""

I use -H20M and -K4M to no avail. It reports the message about 5 seconds
after compilation begins. The type of gr_lib is [(String,HType)] where

        data HType = V String | F String [HType] | C [HType] HType

if that's of any use. Incidentally, the number of columns in line 3 is 492122,
so it doesn't do too badly! Verbose output attached below. Offending PLib.hs
available on request.

In fact, I've just tried compiling a similar module whose line 3 is a meagre
146790 columns, with options -H50M -K20M. After just under 6 minutes, it
reports "GHC's heap exhausted; while trying to allocate 12 bytes in a <very
big> heap".

You might ask what I'm trying to do. I'm trying to find out how much faster
it would be if GHC could load in a data structure directly (from a file),
rather than have to parse a text file. Profiling my search tool for functions
reveals that roughly a fifth of time is spent parsing the library, but it
would be nice to do a "real" comparison. So, a separate program parses a
library and shows it, as a constant, to a fake module, which is linked with
the search tool. Is there another way of doing this?

While I'm here, compiling any module with -prof -auto-all comes up with:

---begin-exact-quote
                 from /tmp/ghc.xx.7598.c:6:
In file included from /tmp/ghc.xx.7598.c:8:
---end-exact-quote

without fail. (The 7598 may vary.) It doesn't seem to affect compilation,
though. If -auto-all is not on, the second line (starting "In file..") doesn't
appear.

Thanks,

Ed

----------------------------------
The Glorious Glasgow Haskell Compilation System, version 0.29 patchlevel 0

Ineffective C pre-processor:
        echo '#line 1 "PLib.hs"' > /tmp/ghc7406.cpp; cat PLib.hs >> /tmp/ghc74
06.cpp

real        0.0
user        0.0
sys         0.0

Haskell compiler:
        /usr/local/haskell/ghc-0.29/lib/ghc/0.29/sparc-sun-solaris2/hsc ,-H ,-
N ,-W ,-p ,-I. ,-J/usr/local/haskell/ghc-0.29/lib/ghc/0.29/imports/hbc ,-J/usr
/local/haskell/ghc-0.29/lib/ghc/0.29/imports/ghc ,-J/usr/local/haskell/ghc-0.2
9/lib/ghc/0.29/imports ,/tmp/ghc7406.cpp  -fomit-derived-read -fglasgow-exts -
fomit-interface-pragmas -fsimplify \( -fdo-new-occur-anal -fdo-arity-expand -f
float-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -freuse-con -fpedan
tic-bottoms -fsimpl-uf-use-threshold0 -fessential-unfoldings-only -fmax-simpli
fier-iterations-10 \) -fuse-get-mentioned-vars   -v -hi/tmp/ghc7406.hi -fasm-s
parc-sun-solaris2 -S/tmp/ghc7406.s +RTS -H20000000 -K4000000
Glasgow Haskell Compiler, version 0.29

"PLib.hs", line 3, column 476908: parser stack overflow on input: ""i""

real        5.3
user        3.0
sys         2.1
deleting... /tmp/ghc7406.hi /tmp/ghc7406.s

rm -f /tmp/ghc7406*

Reply via email to