This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Patch: RAM-based heuristics for ggc-min-heapsize and ggc-min-expand
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: Richard dot Earnshaw at arm dot com
- Cc: gcc-patches at gcc dot gnu dot org, geoffk at geoffk dot org, mstump at apple dot com, rth at redhat dot com, zack at codesourcery dot com
- Date: Mon, 17 Feb 2003 10:29:34 -0500 (EST)
- Subject: Re: [RFC] Patch: RAM-based heuristics for ggc-min-heapsize and ggc-min-expand
- References: <200302170948.h1H9mU521758@pc960.cambridge.arm.com>
> From: Richard Earnshaw <rearnsha@arm.com>
>
> > Richard Earnshaw wants me to put the heuristics in gcc.c and pass it
> > to cc1 (et al) via specs using -param commands. This has the
> > advantage in that bug reports with the output of gcc -v testcase.c
> > will show the memory heuristics used also, in case that is relevant to
> > triggering the bug.
> > http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01011.html
> >
>
> I will withdraw my objection if you can guarantee that specifying memory
> limits on the command line rather than using inbuilt heuristics will
> guarantee not to alter the address at which any data object is allocated.
> The guarantee must hold for all host platforms.
>
> I suspect that in order to do this you must in effect run the heuristic
> (it might somehow end up calling malloc) and then discard the result if
> the command line overrides it.
If I understand you correctly, that's exactly what happens in the
original patch. I.e. the heuristic value is calculated when cc1
initializes itself and setup right before argument processing. If the
appropriate -param argument was supplied, the heuristic value is
discarded and the user's value is substituted.
Sound ok?
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu