[PowerPC, JIT] PPCJITInfo.cpp "This is not a 32bit PowerPC"
Peter Bergner
bergner at vnet.ibm.com
Fri Jul 26 07:14:53 PDT 2013
On Tue, 2013-07-23 at 21:50 -0400, David Fang wrote:
> -#if !defined(__powerpc__) || defined(__powerpc64__)
> +#if (!defined(__ppc__) && !defined(__powerpc__)) || defined(__powerpc64__) || defined(__ppc64__)
I'll note that both the old and new changes are not compatible
with the predefined macros GCC defines. For 64-bit, GCC defines
both __powerpc__ and __powerpc64__ and for 32-bit compiles, it
defines only __powerpc__. This is also true of the IBM XL
compilers. All three compilers need to agree on the settings
of these macros. I know there is user code out in the wild
the depends on the macros being set the way GCC and the XL
compilers define them.
Peter
[bergner at igoo ~]$ cat macros.c
#if defined (__powerpc__)
# warning "__powerpc__ is defined"
#else
# warning "__powerpc__ is undefined"
#endif
#if defined (__powerpc64__)
# warning "__powerpc64__ is defined"
#else
# warning "__powerpc64__ is undefined"
#endif
[bergner at igoo ~]$ gcc -m32 -E empty.c | grep warning
empty.c:2:3: warning: #warning "__powerpc__ is defined"
empty.c:10:3: warning: #warning "__powerpc64__ is undefined"
[bergner at igoo ~]$ gcc -m64 -E empty.c | grep warning
empty.c:2:3: warning: #warning "__powerpc__ is defined"
empty.c:8:3: warning: #warning "__powerpc64__ is defined"
bergner at bns:~> xlc -q32 -E macros.c 2>&1 | grep '^# warning'
# warning "__powerpc__ is defined"
# warning "__powerpc64__ is undefined"
bergner at bns:~> xlc -q64 -E macros.c 2>&1 | grep '^# warning'
# warning "__powerpc__ is defined"
# warning "__powerpc64__ is defined"
More information about the llvm-commits
mailing list