This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Disable ppc/spu context sensitive macros for CLK_ASM preprocessing (PR preprocessor/61977)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: David Edelsohn <dje dot gcc at gmail dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 1 Apr 2015 11:13:33 +0200
- Subject: Re: [PATCH] Disable ppc/spu context sensitive macros for CLK_ASM preprocessing (PR preprocessor/61977)
- Authentication-results: sourceware.org; auth=none
- References: <20150401084028 dot GJ19273 at tucnak dot redhat dot com> <CABu31nMKzzSdxe1V+naOec_xAU+TSQ2zsG==4_MgE1ftQ6e_xA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Apr 01, 2015 at 10:57:10AM +0200, Steven Bosscher wrote:
> On Wed, Apr 1, 2015 at 10:40 AM, Jakub Jelinek wrote:
> > Hi!
> >
> > The context sensitive macros are inherently C/C++ specific, so trying to
> > expand them into anything when preprocessing assembler doesn't make any
> > sense to me.
>
> Why are the <arch>-c.c cpp builtins defined at all when preprocessing
> assembly? Or in other words: should these (supposedly)
> language-dependent hooks for cpp builtins be called if the
> pre-processor is called stand-alone?
The preprocessor, whether invoked through cpp or gcc driver, is still
the C (or C++) FE, and when it doesn't preprocess with -x assembler-with-cpp,
it still preprocesses C and has to define these.
Most of the macros <arch>-c.c defines are needed for assembler preprocessing
too, lots of things would break if there wouldn't be on x86_64 say
__x86_64__ define.
My patch disables just the clearly C/C++ specific macros,
I mean defining __vector to __attribute__((...)) where the definition has
C/C++ syntax clearly isn't very useful in assembler, and vector contextual
macro that expands sometimes to something C specific neither.
Jakub