This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, spu]: support context-sensitive keywords


On Tue, Jul 22, 2008 at 6:10 PM, Ben Elliston <bje@au1.ibm.com> wrote:
> This patch adds context-sensitive keyword support to the SPU target
> ("vector" keyword only).  As the spu_internals.h header already has the
> means to avoid #defining vector when the macro
> __VECTOR_KEYWORD_SUPPORTED__ is defined, this is pre-defined in the
> preprocessor to indicate such support.
>
> I've added two test cases, one with and one without -ansi.  When
> compiling ISO C, the support is disabled.
>
> OK for mainline, pending regression testsuite completing successfully?
This is ok with two small changes.

> gcc/
>        * config/spu/spu-c.c (__vector_keyword): New variable.
>        (vector_keyword): Likewise.
>        (spu_categorize_keyword): New function.
>        (spu_macro_to_expand): Likewise.
>        (spu_cpu_cpp_builtins): Enable context-sensitive macros if not
>        compiling an ISO C dialect.
>
> gcc/testsuite/
>        * gcc.target/spu/vector.c: New test.
>        * gcc.target/spu/vector-ansi.c: Likewise.



> +/* Keep the vector keywords handy for fast comparisons.  */
> +static tree __vector_keyword;
> +static tree vector_keyword;

I think you need a GTY(()) on those variables, otherwise you will end
up with the identifiers getting lost, maybe (I forget when identifiers
are GCable, Tom?).

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]