PATCH: Define _ILP32 and __ILP32__ for x32

H.J. Lu hongjiu.lu@intel.com
Fri Apr 13 17:15:00 GMT 2012


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
     {



More information about the Gcc-patches mailing list