Sure, I'd like to get to the bottom of this because it's such an ugly
declaration in meta phases (that's where the syntax-case monsters reside).
Post by Marc FeeleyI think you should figure out which of the configure options
--enable-single-host
--enable-c-opt
--enable-gcc-opts
are the most useful/beneficial for the kind of code generated by Gerbil.
I suspect that --enable-single-host is the most performance-enhancing
option, and --enable-c-opt only gives a marginal speed increase at the cost
of a much higher C compile time.
If you do try the various combinations, please report your results here.
Iâd like to know if my intuition is correct.
Marc
Post by Dimitris VyzovitisMy gambit is configured with --enable-single-host --enable-c-opt
--enable-gcc-opts.
Post by Dimitris VyzovitisI have 8G on my current laptop, but I run without a swap; the death
occurs at around 6G.
Post by Dimitris VyzovitisIt's not only the memory usage though, it takes forever too. clang on
travis didn't OOM, but it took 15min on the file.
Post by Dimitris VyzovitisI think it might be a case of really bad interaction between the various
optimizers in the 3 compilers involved. The gerbil emitted code is already
heavily optimized to perform match tree linearization (I have a shiny new
optimizer that optimizes match and syntax- case expansions).
Post by Dimitris VyzovitisThat means you can't reasonably inline anything other than single use
procedures within the optimized blocks.
Post by Dimitris Vyzovitis-- vyzo
The default inlining-limit is 350, so the expansion from 100 is quite
possible.
Post by Dimitris VyzovitisBut the problem here is that gcc chokes on the compilation of the C
file. So⊠what are the compilation options passed to gcc?
Post by Dimitris Vyzovitis- are you using --enable-single-host ?
- are you using a higher level of optimization such as -O2 or -O3 rather
than the default -O1 ?
Post by Dimitris VyzovitisThese will definitely increase the pressure on the C compiler. Also,
some versions of gcc do a better job at compiling large C files. The file
lib/_io.c in the Gambit distribution is about 90kloc and I have never
gotten an OOM error from gcc while compiling it, even though I use a âmake
-j 8â (8 C compilations in parallel). I do have 16 GB of RAM on my
machine⊠how much RAM do you have on yours?
Post by Dimitris VyzovitisMarc
Post by Dimitris VyzovitisIt's 140kloc without the inlining declaration and just 22Kloc with the
declaration.
Post by Dimitris VyzovitisPost by Dimitris Vyzovitis-- vyzo
Out of curiosity, what is the number of LOC of C with and without the
inlining-limit?
Post by Dimitris VyzovitisPost by Dimitris VyzovitisIâm just wondering if this should be classified as an issue, or if the
inliner is just doing its work as expected.
(inlining-limit 100)), then it compiles in 20s.
Post by Dimitris VyzovitisPost by Dimitris VyzovitisPost by Dimitris Vyzovitis-- vyzo
On Mon, Mar 19, 2018 at 7:29 PM, Dimitris Vyzovitis <
The attached file results in a 140kloc monster that results in gcc
dying with OOM after several minutes of effort, and I would like to
understand why.