diff mbox

PATCH [2/n] X32: Turn on 64bit and check models for x32

Message ID 20110709212239.GA3503@intel.com
State New
Headers show

Commit Message

H.J. Lu July 9, 2011, 9:22 p.m. UTC
Hi,

This patch turns on 64bit and check models for x32.  OK for trunk?

Thanks.

H.J.
---
2011-07-09  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_option_override_internal): Turn on
	OPTION_MASK_ISA_64BIT for TARGET_X32.  Only allow small and
	small PIC models for TARGET_X32.

Comments

Uros Bizjak July 10, 2011, 2:17 p.m. UTC | #1
On Sat, Jul 9, 2011 at 11:22 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> This patch turns on 64bit and check models for x32.  OK for trunk?
>
> Thanks.
>
> H.J.
> ---
> 2011-07-09  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * config/i386/i386.c (ix86_option_override_internal): Turn on
>        OPTION_MASK_ISA_64BIT for TARGET_X32.  Only allow small and
>        small PIC models for TARGET_X32.

OK.

Thanks,
Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 04cb07d..c852719 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2973,6 +2973,9 @@  ix86_option_override_internal (bool main_args_p)
   SUBSUBTARGET_OVERRIDE_OPTIONS;
 #endif
 
+  if (TARGET_X32)
+    ix86_isa_flags |= OPTION_MASK_ISA_64BIT;
+
   /* -fPIC is the default for x86_64.  */
   if (TARGET_MACHO && TARGET_64BIT)
     flag_pic = 2;
@@ -3064,6 +3067,9 @@  ix86_option_override_internal (bool main_args_p)
 	  if (!TARGET_64BIT)
 	    error ("code model %qs not supported in the %s bit mode",
 		   "medium", "32");
+	  else if (TARGET_X32)
+	    error ("code model %qs not supported in x32 mode",
+		   "medium");
 	  break;
 
 	case CM_LARGE:
@@ -3073,6 +3079,9 @@  ix86_option_override_internal (bool main_args_p)
 	  if (!TARGET_64BIT)
 	    error ("code model %qs not supported in the %s bit mode",
 		   "large", "32");
+	  else if (TARGET_X32)
+	    error ("code model %qs not supported in x32 mode",
+		   "medium");
 	  break;
 
 	case CM_32: