From patchwork Thu Jan 3 00:58:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 209165 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 5CBD72C0084 for ; Thu, 3 Jan 2013 11:58:23 +1100 (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=1357779504; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:To:Subject:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:From: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=OGlnVLp9dIVsgvSIJS+V TAG+NVQ=; b=WyeYLiKbw5/RqNUJBUaARtKbb6fxKbsHrsF/ljJ9c7/CeUDztu3l Sc2tmVDFbSbqwezURrvEFeOnPEn+gn6v/7y6Q10+skCAqDFMKBH8KOslaTzdFCbR oo7KtFSpryMJIPeyfBeDmfIPgDJwf3CsMNHbgg0jMnrNpDzl1n4Bq54= 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:X-Google-DKIM-Signature:X-Received:Received:Received:Received:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=I2WoZGP4aOiU2Q1mcclS+5f/sTwqEceZK6MS9TA5irGYuDlLQHZudXnp8AiEvP +a8cZdkyzoozbfT/q3pXlt4PyYkkZkW/gzTC20a4F/rKesTS1t/lzeNLy4MhF24o UgYqGQYEslgtnz7JvFDUr2WtIcxNV1rFfP1XedZTC3J5I=; Received: (qmail 11043 invoked by alias); 3 Jan 2013 00:58:15 -0000 Received: (qmail 11033 invoked by uid 22791); 3 Jan 2013 00:58:13 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gg0-f201.google.com (HELO mail-gg0-f201.google.com) (209.85.161.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jan 2013 00:58:09 +0000 Received: by mail-gg0-f201.google.com with SMTP id o6so1567116ggm.4 for ; Wed, 02 Jan 2013 16:58:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:to:subject:user-agent:mime-version:content-type :content-transfer-encoding:message-id:from:x-gm-message-state; bh=SnMR8/i1cgdt7V+bEUURn+s7GrSxFMaJW642BQtnm58=; b=i2p3UzMzFzCM379CSSljvP9NLziugJrT9OBPFnYjzKnqrAQ0SLXw0t8NnmYKBF/bHu DXpHY0y/jNuYO7EmQNApyE6fv05mTQBr/GKg5QKidUItuZ6EZhiSJGpJLD7X6Aemk2/N h4exWin1PGBtI5WSzztISP0SWxKMkqj52Xscn+RnJVIFdegm+ZSvkrdxgrm/62onNFm6 qNKlXla8O6vywcytZ2Wnu5Hl/czWrw3+2FmAgopsQ8XIBoDhecN9hDGPViBA1fPsITvW l5lBmHFQ9y40kDzA91kVlo4Q8qWSrupU1soNMaRTwZDsDeJ7bk3HY5FiNAGUNAgOM29h tCdA== X-Received: by 10.236.193.106 with SMTP id j70mr24096761yhn.11.1357174688694; Wed, 02 Jan 2013 16:58:08 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id l20si3836400yhi.2.2013.01.02.16.58.08 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 02 Jan 2013 16:58:08 -0800 (PST) Received: from rong.mtv.corp.google.com (rong.mtv.corp.google.com [172.17.128.127]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 874DC100047; Wed, 2 Jan 2013 16:58:08 -0800 (PST) Received: by rong.mtv.corp.google.com (Postfix, from userid 104659) id 21730100706; Wed, 2 Jan 2013 16:58:08 -0800 (PST) Date: Wed, 02 Jan 2013 16:58:07 -0800 To: gcc-patches@gcc.gnu.org, davidxl@google.com, reply@codereview.appspotmail.com Subject: [google 4_7] fix unsat for target w/o atomic builtins (issue7031051) User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20130103005808.21730100706@rong.mtv.corp.google.com> From: xur@google.com (Rong Xu) X-Gm-Message-State: ALoCoQnN0hZure/LPoTxg51MLFnPn8+Tx3CglEXJbVkcUOX2nVTi+R2esI0LE09do06iUjcGOTFcp3YdJbgdo2k4Xb8gtT1BaGl6hfuFtUCPiO9BoBPu26flNUwgwPqHQYRvEFDF26U3jXfsbdSBqUwtCNH75rkakZbwiRBPoC7G+mI+0WFy0Rm2QBJ+MnuOR4gWUvAoO5X1 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 Hi, This patch fixes an issue in r194725. The call to atmoic builtin is emmitted regardless of -fprofile-gen-atomic -- which results in link unsat for targets without sync builtin support. Tested with regression test in x86 (with builtin support.) and powerpc32 (without builtin support). Thanks, -Rong 2013-01-02 Rong Xu * gcc/gcov-io.h: Make __atomic_fetch_add weak for these target without sync builtin support. --- This patch is available for review at http://codereview.appspot.com/7031051 Index: gcc/gcov-io.h =================================================================== --- gcc/gcov-io.h (revision 194739) +++ gcc/gcov-io.h (working copy) @@ -308,6 +308,10 @@ typedef unsigned gcov_type_unsigned __attribute__ #define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4 #define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4 #endif +/* Make the atomic builtin weak. Otherwise we get link unsat + if the builtin is not available. */ +extern gcov_type GCOV_TYPE_ATOMIC_FETCH_ADD_FN + (gcov_type*, gcov_type, int) __attribute__ ((weak)); #undef EXTRACT_MODULE_ID_FROM_GLOBAL_ID #undef EXTRACT_FUNC_ID_FROM_GLOBAL_ID