From patchwork Mon Jun 25 07:53:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 166989 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 7D1BAB6EEC for ; Mon, 25 Jun 2012 17:54:09 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1341215649; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-ID:CC:To:MIME-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=cvZ7YdF6YCO8JmMMi1dZxo7lqIs=; b=nRKfmRykZSR2nWL Wzn0ZD2S9t4lUFSOtnapcofjzoal8xrcbvwAgtXVZaqvyH+BsRUxTeO08Fe6yUpA QnoTq+SU9STS9qIRXuIqTUUV7UyWKh4O754t7LnCJE3yc8AhFEG+A2ExLDOu3LAp exT2h1FNla3nIjZJH8O/8t7KnPCE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-ID:CC:To:MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oo+7grJWPo+4cnQLQddIsbhZvPTLx02ANz6xH/zzUhALFWbygnm6L61dPxKBZL m3isavox+ZoCgO1JIjbJI9gRVXJpEXtazK5Jket62z/vRnlAUxdJ9Imc5MPJRfBa xGzs6xHR6RajIJqOfOlY0BPOuTc60mZCrTg82DU3WfADU=; Received: (qmail 21628 invoked by alias); 25 Jun 2012 07:53:56 -0000 Received: (qmail 21594 invoked by uid 22791); 25 Jun 2012 07:53:54 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Jun 2012 07:53:41 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Sj47A-0001kH-N2 from Iain_Sandoe@mentor.com ; Mon, 25 Jun 2012 00:53:40 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 25 Jun 2012 00:53:40 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.1.289.1; Mon, 25 Jun 2012 08:53:38 +0100 From: Iain Sandoe Subject: [Patch, Darwin, x86] fix 53283 Date: Mon, 25 Jun 2012 08:53:36 +0100 Message-ID: <097D2BAD-3A64-4EF9-B6C9-03E31F51B904@codesourcery.com> CC: Mike Stump To: GCC Patches MIME-Version: 1.0 (Apple Message framework v1084) 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 As described in the PR thread, Darwin was already using the TARGET_FOLD_BUILTIN hook to process CFstrings. The patch fixes the breakage by calling a SUBTARGET_FOLD_BUILTIN where defined (following similar patterns for other items that require sub-target handling). OK for trunk? Iain gcc: PR target/53283 * config/i386/i386.c (ix86_fold_builtin): Call SUBTARGET_FOLD_BUILTIN if defined. * config/darwin.h: Rename TARGET_FOLD_BUILTIN to SUBTARGET_FOLD_BUILTIN. * config/rs6000/darwin.h: Map TARGET_FOLD_BUILTIN onto SUBTARGET_FOLD_BUILTIN. Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 188918) +++ gcc/config/i386/i386.c (working copy) @@ -28030,6 +28030,10 @@ ix86_fold_builtin (tree fndecl, int n_args, } } +#ifdef SUBTARGET_FOLD_BUILTIN + return SUBTARGET_FOLD_BUILTIN (fndecl, n_args, args, ignore); +#endif + return NULL_TREE; } Index: gcc/config/rs6000/darwin.h =================================================================== --- gcc/config/rs6000/darwin.h (revision 188918) +++ gcc/config/rs6000/darwin.h (working copy) @@ -422,3 +422,7 @@ do { \ rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)] \ = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \ } while(0) + +/* So far, there is no rs6000_fold_builtin, if one is introduced, then + this will need to be modified similar to the x86 case. */ +#define TARGET_FOLD_BUILTIN SUBTARGET_FOLD_BUILTIN Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 188918) +++ gcc/config/darwin.h (working copy) @@ -912,7 +909,7 @@ void add_framework_path (char *); #define TARGET_KEXTABI flag_apple_kext /* We have target-specific builtins. */ -#define TARGET_FOLD_BUILTIN darwin_fold_builtin +#define SUBTARGET_FOLD_BUILTIN darwin_fold_builtin #define TARGET_N_FORMAT_TYPES 1 #define TARGET_FORMAT_TYPES darwin_additional_format_types