This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, committed] PPC405 atomic support (PR target/21760)
David Edelsohn <firstname.lastname@example.org> writes:
> >>>>> Andreas Schwab writes:
> >> + /* If configured for PPC405, support PPC405CR Erratum77. */
> >> + #define PPC405_CPU_DEFAULT ("405")
> >> + #if #TARGET_CPU_DEFAULT == #PPC405_CPU_DEFAULT
> Andreas> What is this expression supposed to do? It doesn't match
> anything defined by C89.
> The expression is comparing the stringified value of the macros.
I'm pretty sure that doesn't work, and in fact should be an error;
even C99 says that "The expression that controls conditional inclusion
shall be an integer constant expression" (and I think the "shall" in
this location requires a diagnostic). I filed
to track it.
I think you might be able to get away with
#define ppc405_is_default (strcmp(TARGET_CPU_DEFAULT, "405") == 0)
with no cost at runtime, since gcc will fold the strcmp.