From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32484 invoked by alias); 7 Jan 2013 20:56:03 -0000 Received: (qmail 32474 invoked by uid 22791); 7 Jan 2013 20:56:02 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jan 2013 20:55:56 +0000 Received: by mail-ob0-f178.google.com with SMTP id eh20so18175753obb.9 for ; Mon, 07 Jan 2013 12:55:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=pC7yIosjmFWLHxezvPwoduIxHoeCRA92uRh8i8XKBo0=; b=ZZsYhyuA8uF2HoKD/zbmAVB1LEhP5IJDBb2cN8DA7Tn9rQZz7/pbMurrvMRntFjKM4 vASnJn+LHWfZRlc5Y9qCZjzHvS/7c7kMvvugHWQ9anPzxyfVgbQ8X6JpzCUVqEbntH9w uNbPPiKXk4LoFDM/xPKtkfjd+dauDEl9AM/WbQ+JZ4JnmP6e6s1w5hGuiJndMH7q4Ob0 tgDr9QDSLGZTlAjk+scXMl+mFXO1tkmx13TJaUMmF2QtkSguV6qQAnbFaZB8yvbUjoH6 TNyKMHUyjDYcudx/7cCjOHUug1wIp5DMulLOmpEhRxYKM3dR2kLr8uek9s3gluvU9aRj /5UQ== MIME-Version: 1.0 Received: by 10.60.0.165 with SMTP id 5mr35362429oef.128.1357592156258; Mon, 07 Jan 2013 12:55:56 -0800 (PST) Received: by 10.60.94.43 with HTTP; Mon, 7 Jan 2013 12:55:56 -0800 (PST) In-Reply-To: <50EB31B7.9090307@redhat.com> References: <20121221064539.0E1A7100704@rong.mtv.corp.google.com> <20121221092532.GA7055@kam.mff.cuni.cz> <50EB31B7.9090307@redhat.com> Date: Mon, 07 Jan 2013 20:56:00 -0000 Message-ID: Subject: Re: atomic update of profile counters (issue7000044) From: Rong Xu To: Richard Henderson Cc: Richard Biener , Andrew Pinski , Xinliang David Li , Jan Hubicka , GCC Patches , reply@codereview.appspotmail.com Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlknqCMtLsjqku8njxXvghFyLz4DqVnoS1mm6/BCbXuHaP8YmOOh5YfXpotcdNNh+Bwpk8XO56N8vObmNs3CBU/BdJhBPVm6LeEbFUKJeMnCWGS/d+II1kk5VmlU/zj3ews8mPCeigVWYOQPIcY2ZDxAWfQ8Dpea2q0XjhpgVU+pGfF5xWIKtLCJwnDQbtT566QcgMh X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00360.txt.bz2 Function __gcov_indirect_call_profiler_atomic (which contains call to the atomic function) is always emitted in libgcov. Since we only link libatomic when -fprofile-gen-atomic is specified, we have to make the atomic function weak -- otherwise, there is a unsat for regular FDO gen build (of course, when the builtin is not expanded). An alternative it to always link libatomic together with libgcov. Then we don't need the weak stuff. I'm not sure when one is better. -Rong On Mon, Jan 7, 2013 at 12:36 PM, Richard Henderson wrote: > On 01/03/2013 04:42 PM, Rong Xu wrote: >> It links libatomic when -fprofile-gen-atomic is specified for FDO >> instrumentation build. Here I assume libatomic is always installed. >> Andrew: do you think if this is reasonable? >> >> It also disables the functionality if target does not support weak >> (ie. TARGET_SUPPORTS_WEAK == 0). > > Since you're linking libatomic, you don't need weak references. > > I think its ok to assume libatomic is installed, given that the > user has had to explicitly use the command-line option. > > > r~