This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Implementing unit-at-a-time for C++
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Devang Patel <dpatel at apple dot com>, Richard Henderson <rth at redhat dot com>, snyder <snyder at fnal dot gov>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 05 Mar 2003 09:53:34 -0800
- Subject: Re: Implementing unit-at-a-time for C++
--On Wednesday, March 05, 2003 06:33:30 PM +0100 Jan Hubicka <jh at suse dot cz>
wrote:
Any idea how much work would be needed to get this working in the new way?
It wouldn't be that hard.
With -fsyntax-only, you'll see that DECL_NEEDED_P is computed more
generously. If you use that more generous definition all the time, you'll
probably get rid of the dependency on what varasm.c decides to emit.
However, you might end up with bigger .o files and slower compile times.
The current scheme allows us to avoid presenting the back end with the body
of f<int> in this case:
g() { if (0) f<int>(); }
Because varasm.c doesn't emit the call, we don't ever generate RTL for
f<int>.
When the tree optimization stuff is working, we could presumably go to
unit-at-a-time, and get the same results. Until the optimization is
working, we'd end up thinking that the body of f<int> is needed.
--
Mark Mitchell mark at codesourcery dot com
CodeSourcery, LLC http://www.codesourcery.com