From a1f91bca13c252376afb41e1fd14fe684beac5f1 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 10 Jul 2011 19:25:28 +0000 Subject: [PATCH] Turn on 64bit and check models for x32. 2011-07-10 H.J. Lu * 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. From-SVN: r176127 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e654d17323b..bbec3f0ae23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-07-10 H.J. Lu + + * 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 PR target/49684 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 04cb07d5740..f3fd0dba30b 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: -- 2.30.2