Extreme memory demand compiling not-too-complicated expression: gcc bug?
Bob McKay
urilabob@gmail.com
Wed Apr 11 11:00:00 GMT 2012
Dear gcc-ers,
I need to compile fairly complex (automatically generated)
expressions using gcc. An example is attached. To allow the code to
run reasonably fast, I assumed it would be reasonable to macro-ise the
functions where possible (most operators need to be protected against
overflow, since I can't control the expressions that are generated),
and inline the rest. Inlining works fine (the code compiles in a
fraction of a second), but macro-ising doesn't. This version of the
code ran up to 14GB of (real) memory and ~15 minutes compilation time
before I killed it. While it doesn't matter much to me (the inlined
version is still a huge speed-up on the interpreter I was using till
now), it does seem a little surprising that compiling a relatively
simple expression should generate such overheads. I could understand
it, I guess, if I were using aggressive optimisations; but the same
overheads appeared even under minimum optimisation. So back to the
question: does this look like a bug to you? Should I be reporting it?
Even better, can anyone suggest a combination of switches that will
allow it to compile in a reasonable time and memory?
Thanks and Best Wishes
Bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bex.c
Type: text/x-csrc
Size: 2365 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120411/76bd8ce8/attachment.bin>
More information about the Gcc-help
mailing list