OSDN Git Service

Turn on 64bit and check models for x32.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Jul 2011 19:25:28 +0000 (19:25 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Jul 2011 19:25:28 +0000 (19:25 +0000)
2011-07-10  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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176127 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index e654d17..bbec3f0 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-10  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.
+
 2011-07-10  Hans-Peter Nilsson  <hp@axis.com>
 
        PR target/49684
index 04cb07d..f3fd0db 100644 (file)
@@ -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: