https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122414
Bug ID: 122414
Summary: The _ARCH_PPC64 macro has unclear semantics
Product: gcc
Version: 14.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: martin at netbsd dot org
Target Milestone: ---
Older gcc versions did define _ARCH_PPC64 when compiling for a powerpc 64 bit
target. This is consistent with (AFAICT) how clang defines this macro.
With gcc 14 I get:
> powerpc--netbsd-gcc -m32 -mcpu=970 -dM -E - < /dev/null | fgrep ARCH
#define _ARCH_PPCGR 1
#define _ARCH_PPCSQ 1
#define _ARCH_PPC 1
#define _ARCH_PWR4 1
#define _ARCH_PPC64 1
and the same output without -m32. Older version dropped the _ARCH_PPC64 define
when -m32 was in effect.
Application software uses _ARCH_PPC64 with various meanings (most often in a
long #if | expression together with _powerpc_, _ARCH_PPC and others to identify
any kind of powerpc cpu), but I found at least one example that now breaks:
sljit uses it to tell 64bit powerpc code from 32bit.
NetBSD does the same, and we are trying to decide if this is a bug that we
should fix (which would be straight forward, once the semantics of _ARCH_PPC64
are clear). I found no documentation that really tells me what it should mean.