[PATCH] Add target hook in C front end

Zack Weinberg zack@codesourcery.com
Sun Dec 16 14:09:00 GMT 2001


On Sun, Dec 16, 2001 at 01:44:06PM -0800, Eric Christopher wrote:
> > 
> > This patch breaks -save-temps.  We revert to the external preprocessor
> > for that mode.
> 
> It seemed to work for me when I was debugging this... could you provide
> an example for me?

If I understood your patch correctly, when you compile

__SIZE_TYPE__ i;

with -save-temps, the .i file will read

__SIZE_TYPE__ i;

This is wrong.  It will be rejected by a compiler that doesn't treat
__SIZE_TYPE__ as magic.  You'd be more on the right track if you made
calls to cpp_define() from your special hook routine.  However, then
-save-temps would ignore the setting for __SIZE_TYPE__ made by the -m
switches, which is also wrong.

The principle here is that, for a platform-independent bug, I ought to
be able to take source code preprocessed by a MIPS compiler, run it
through my x86 compiler, and still see the bug.  Your change prevents
that.

Joseph Myers has proposed that -save-temps cause cc1 to write out an
.i file as a side effect.  If that change were made, then a patch
along these lines would be fine; until then, handling of __SIZE_TYPE__
must remain in the specs.

zw



More information about the Gcc-patches mailing list