This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: distcc and ccache speedup: adds directives-only preprocessing
> Usage is straightforward. The -directives-only flag is simply added
> to the compiler options passed to distcc or ccache.
This flag name conflicts with the existing -dCHARS and -dLETTERS
options already present in cpp and gcc, respectively.
Ah, I was unaware of the -dLETTERS option in gcc. At the moment, it
doesn't actually interfere -- both versions work and are callable --
but I agree that this could be confusing.
I suggest something like -dF (fast) or some -f option.
I don't like the -dF suggestion because this doesn't fit the mold of a
dump operation. During preprocessing, it does share the macro output
portion, but that's about it. It also includes special handling
during the compilation stage: if -fpreprocessed is set, it disables
automatic definition of most builtin macros.
How does -fdirectives-only sound?
> Tested with a C/C++ bootstrap and testsuite run on i686-pc-linux-gnu.
Have you run the C testsuite using this option? It would be nice to
make sure it doesn't break any of the corner cases of tokenization.
I did add a couple test cases specific to this patch. I also compiled
a large subset of Google's internal codebase with this. The test case
includes the various issues I ran into, some feedback from Ian Taylor,
as well as some corner cases of my own devising.
The directives-only option is a null-op unless compilation is done as
a two stage process: first preprocessing, then compilation. I'd need
to modify the C testsuite accordingly in order to do a full run. I'm
not terribly familiar with dejagnu in general and gcc's test code in
particular, but if you could give me some pointers, I'd be willing to
try it out.
You should also make sure it doesn't interfere destructively with
the -dCHARS options documented in the cpp manual. It seems to me like
it might.
It does interfere with -dN and -dD. These are fundamentally
incompatible with directives-only, though, since directives-only
preprocessing requires macro definitions to be output (to enable
deferral of macro expansion). At the moment, directives-only takes
precedence, though this could be changed.
What would you suggest? Is there a good rationale for choosing one
over the other?
Ollie