* invoking gcc multiple times in the same process
@ 2001-05-08 7:02 Fergus Henderson
0 siblings, 0 replies; only message in thread
From: Fergus Henderson @ 2001-05-08 7:02 UTC (permalink / raw)
To: gcc
For the Mercury front-end to GCC, I'm using the same driver
as in the existing Mercury compiler, rather than the gcc.c driver.
This driver invokes the GCC back-end in the same process, and wants to
do so multiple times.
Unfortunately, however, if you call GCC's toplev_main() twice in the same
process, then it breaks. The symptom is that on the second invocation
GCC tries to consume way too much memory and eventually gets killed.
(This was using a snapshot from early this year).
I haven't investigated the cause, but obviously the code never expected
to be invoked twice, and isn't cleaning up after itself properly.
Any guesses as to roughly how much work it would be to fix that?
Currently I'm working around it, by only invoking toplev_main() at
most once. But this is a bit inelegant (particularly because it is
inconsistent with the way the Mercury driver handles other back-ends.)
I'm wondering whether it is worth trying to fix the GCC back-end
so that it can handle being called multiple times.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-08 7:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-08 7:02 invoking gcc multiple times in the same process Fergus Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).