This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Best way to remove cpp0
- To: neil at daikokuya dot demon dot co dot uk (Neil Booth)
- Subject: Re: Best way to remove cpp0
- From: Joern Rennecke <amylaar at onetel dot net dot uk>
- Date: Mon, 15 Oct 2001 01:41:37 +0100 (BST)
- Cc: zack at codesourcery dot com (Zack Weinberg), joseph at daikokuya dot demon dot co dot uk, gcc at gcc dot gnu dot org
Neil Booth wrote:
>
> I'm considering (gradually) moving the functionality of cppmain.c into
> the main library, and then dropping cpp0. Then cc1 or cc1plus etc.
> would contian the only preprocessor, including the stand-alone case.
>
> The cc1 binary could then act in three states:
>
> 1) Stand-alone preprocessor (invoked with "cpp")
> 2) Compiler-integrated preprocessor ("gcc", "g++" etc.)
The Gnu coding standards say you shouldn't make the program behaviour
dependent on the name the program is invoked with.
> 3) Both (something like "gcc -save-temps")
This is just asking for Heisenbugs. You want to be able to feed the .i
file into cc1 with the same result as when you invoke the driver with
--save-temps, so you better actually feed the .i file into cc1 the first
time too.
Whether that .i file is generated by a binary called cpp0 or cc1 with some
fancy options is not material for this issue, of course.
On the other hand, you are going to use a binary that has extra functionality
that is seldom used (stand-alone preprocessing) for another task that
happens very often. We currently don't have a sufficiently advanced
profile based feedback infrastructure to avoid increasing the working
set size by interleaving used code with unused code from the extra
functionality.
> This would remove a few issues with the existing codebase, and allow
> for more efficient preprocessed output, since that code can be part of
> cpplib without destroying encapsulation. We could also simplify some
> nasty specs in gcc.c, I imagine.
I can't follow you here. Why is it posible to make a cc1-cum-cpp binary
with more efficient preprocessed output more easily than a single-purpose
cpp binary?