From patchwork Thu Sep 11 19:52:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 388360 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3D9211400B5 for ; Fri, 12 Sep 2014 05:52:45 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=fiAXSHcC6gJRd39aAdr6qFzPNaXE6 KT1ED+4iIInUdlnhjrSQOY7mws0KIeDQHnGCu0tlCHhqsZfDgP5hWrbozRWNlZ37 gOEib8+bP0hqXOQcHjJ5cxB39dSYZJYCbJnUkXn1pIH1RPNNdjkQsKIG+C2FHDAB WOXo+eWsBx7hEw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=KyPrrIBaewzfgS8UdajtEW3GmPw=; b=dBa bJBg2JRr7CcUwm7ag/TH4YsQNjcKgo/FY1kqd3Ro5YY5G5P/LCdK7QLHKceqKxoV fCnJ3PL5RsiOmvymIVOHpdjzd9T6k2DmappxMjImW3AMFKpth3uHMt+Y3WBMc/ug U0BYlod+Wojs6pCa432XL4tKJve4thNW4T8LOsX8= Received: (qmail 12215 invoked by alias); 11 Sep 2014 19:52:38 -0000 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 Received: (qmail 12203 invoked by uid 89); 11 Sep 2014 19:52:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FORGED_REPLYTO, NO_DNS_FOR_FROM, RP_MATCHES_RCVD, T_SMF_FM_FORGED_REPLYTO autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Sep 2014 19:52:37 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Sep 2014 12:46:09 -0700 X-ExtLoop1: 1 Received: from gnu-mic-2.sc.intel.com ([172.25.70.58]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2014 12:52:16 -0700 Received: by gnu-mic-2.sc.intel.com (Postfix, from userid 1000) id 46A9A12127F; Thu, 11 Sep 2014 12:52:16 -0700 (PDT) Date: Thu, 11 Sep 2014 12:52:16 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: PATCH: PR target/63228: -m16 doesn't work if gcc is compiled for x32 Message-ID: <20140911195216.GA27037@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) ix86_option_override_internal turns off OPTION_MASK_ABI_X32 for -m64 when TARGET_BI_ARCH == 2. But it fails to do so for -m16. This patch also turns off OPTION_MASK_ABI_X32 for -m16. OK for trunk and 4.9 branch after testing on Linux/x86-64 with -mx32? Thanks. H.J. --- 2014-09-11 H.J. Lu PR target/63228 * config/i386/i386.c (ix86_option_override_internal): Also turn off OPTION_MASK_ABI_X32 for -m16. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8f45e52..cb308c9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3346,8 +3346,9 @@ ix86_option_override_internal (bool main_args_p, /* When TARGET_BI_ARCH == 2, by default, OPTION_MASK_ABI_X32 is on and OPTION_MASK_ABI_64 is off. We turn off OPTION_MASK_ABI_X32 if OPTION_MASK_ABI_64 is turned on by - -m64. */ - if (TARGET_LP64_P (opts->x_ix86_isa_flags)) + -m64 or OPTION_MASK_CODE16 is turned on by -m16. */ + if (TARGET_LP64_P (opts->x_ix86_isa_flags) + || TARGET_16BIT_P (opts->x_ix86_isa_flags)) opts->x_ix86_isa_flags &= ~OPTION_MASK_ABI_X32; #endif }