This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Define _ILP32 and __ILP32__ for x32
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Fri, 13 Apr 2012 10:14:56 -0700
- Subject: PATCH: Define _ILP32 and __ILP32__ for x32
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch defines _ILP32 and __ILP32__ for x32 as specified by x32 psABI.
OK for trunk and 4.7 branch?
Thanks.
H.J.
---
2012-04-13 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386-c.c (ix86_target_macros): Define _ILP32
and __ILP32__ for x32.
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 8adb3b4..49fd4d9 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -383,6 +383,11 @@ ix86_target_macros (void)
cpp_define (parse_in, "__amd64__");
cpp_define (parse_in, "__x86_64");
cpp_define (parse_in, "__x86_64__");
+ if (TARGET_X32)
+ {
+ cpp_define (parse_in, "_ILP32");
+ cpp_define (parse_in, "__ILP32__");
+ }
}
else
{