From patchwork Sat Jul 9 21:22:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 104026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8BEE3B71BC for ; Sun, 10 Jul 2011 07:22:51 +1000 (EST) Received: (qmail 13797 invoked by alias); 9 Jul 2011 21:22:50 -0000 Received: (qmail 13789 invoked by uid 22791); 9 Jul 2011 21:22:49 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jul 2011 21:22:36 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Jul 2011 14:22:35 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga001.jf.intel.com with ESMTP; 09 Jul 2011 14:22:35 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id E5A06C02E3; Sat, 9 Jul 2011 14:22:39 -0700 (PDT) Date: Sat, 9 Jul 2011 14:22:39 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org, Uros Bizjak Subject: PATCH [2/n] X32: Turn on 64bit and check models for x32 Message-ID: <20110709212239.GA3503@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, This patch turns on 64bit and check models for x32. OK for trunk? Thanks. H.J. --- 2011-07-09 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. 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: