From patchwork Thu Jan 20 12:41:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 79679 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 F1A64B70DA for ; Thu, 20 Jan 2011 23:42:01 +1100 (EST) Received: (qmail 17806 invoked by alias); 20 Jan 2011 12:41:59 -0000 Received: (qmail 17767 invoked by uid 22791); 20 Jan 2011 12:41:58 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pw0-f47.google.com (HELO mail-pw0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 12:41:50 +0000 Received: by pwi8 with SMTP id 8so105108pwi.20 for ; Thu, 20 Jan 2011 04:41:48 -0800 (PST) Received: by 10.143.40.13 with SMTP id s13mr2026387wfj.70.1295527308682; Thu, 20 Jan 2011 04:41:48 -0800 (PST) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id f5sm1256564wfo.16.2011.01.20.04.41.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 Jan 2011 04:41:47 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 2EE36170C272; Thu, 20 Jan 2011 23:11:36 +1030 (CST) Date: Thu, 20 Jan 2011 23:11:36 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: PowerPC -mcmodel preprocessor define Message-ID: <20110120124136.GE11694@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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 Someone in IBM (Ulrich Weigand?) observed that some powerpc asm may need changing for -mcmodel=medium, so it would be a good idea to define builtin macros to allow selection of the correct asm. Bootstrapped etc. powerpc64-linux. OK for 4.6? I know this isn't a regression fix, but I'm hoping the rules can be bent enough for this to go in. * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Add builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__. Index: gcc/config/rs6000/rs6000-c.c =================================================================== --- gcc/config/rs6000/rs6000-c.c (revision 167467) +++ gcc/config/rs6000/rs6000-c.c (working copy) @@ -385,6 +385,20 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfi builtin_define ("__LONGDOUBLE128"); } + switch (TARGET_CMODEL) + { + /* Deliberately omit __CMODEL_SMALL__ since that was the default + before -mcmodel support was added. */ + case CMODEL_MEDIUM: + builtin_define ("__CMODEL_MEDIUM__"); + break; + case CMODEL_LARGE: + builtin_define ("__CMODEL_LARGE__"); + break; + default: + break; + } + switch (rs6000_current_abi) { case ABI_V4: