mips cc1 spec vs. fp reg defines vs. assembly code

Neil Booth neil@daikokuya.demon.co.uk
Sun Jun 9 04:25:00 GMT 2002


Chris G. Demetriou wrote:-

> But in fact it wasn't so sane after all:
> 
> * -mfp64 wasn't being passed to cc1 -- I'd guess because it was doing
>    preprocessed assembly, and the -mfp64 was specified in CC1_SPEC --
>    and therefore TARGET_FLOAT64 wasn't true.
> 
> * __mips_fpr wasn't being defined _at all_, I guess because
>   TARGET_CPU_CPP_BUILTINS wasn't being invoked for preprocessed
>   assembly?
> 
> 
> I didn't trace through the code so i'm not 100% sure that I understand
> what's going on, but my hypothesis fits my data.  8-)
> 
> Does this sound plausable?  is TARGET_CPU_CPP_BUILTINS expected to be
> used for preprocessed assembly?  What should one do with things that
> used to be in CC1_SPEC that drive decisions that need to be put into
> CPP defines (even for preprocessed asm)?  put those things into
> CPP_SPEC?

The traditional preprocessor doesn't get these macros, since it is not
integrated.  I suspect you're using -traditional-cpp or similar to do
this.

I'm working on integrating the traditional preprocsesor (see cpptrad.c
and my recent patches) in order to get it done for 3.2.  I cannot
promise, however.

You could try using ISO CPP to do the assembler; I'd be curious to
know if and where it fails.

Today I hope to get function-like macro invocations working for
the integrated traditional preprocessor.  That will leave:

1) Directives (fairly big job, but mostly shared with ISO CPP)
2) Traditional output (trivial job)
3) Special builtins e.g. __LINE__ (trivial job)
4) defined() and assertions not macro expanded (dunno how hard)

Assuming 1) doesn't turn out to be harder than I thought, there
shouldn't be a problem for 3.2.

Apart from the advantage of getting the target built-in macros,
the code is a lot cleaner than the existing tradcpp.[ch], and
we get all the infrastructure ISO CPP has that traditional CPP
doesn't, e.g. -H and -dD, -dN, -dI etc, for free.

Not having to special-case traditional preprocessing will also
clean up the CPP specs in gcc.c 8-)

Neil.



More information about the Gcc mailing list