From patchwork Sat Jun 4 12:12:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 630166 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 3rMKbV1Grsz9t5l for ; Sat, 4 Jun 2016 22:12:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=bzUEbw16; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=QjzuOgMCuKFE8dDQ EHv/3fa+Jo9B54OItCDGLKDwEszZH/MBBrarkdHuVhRS1uCT8gaQl8+jhUS/+vXm EjYjs3X8h/j9xJK/lmf95RFzVKcWaC8/JHM2YGe0DZDt0UkPMu/R+xYIWbAQgovC j405ie5J+v2yxuV9Hlub1x75AF0= 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=fCYlBCn3PjNlD1enQkDFYU 0SKrM=; b=bzUEbw16wxiJitMybBTbLazAN/I621hbQM3pF3Vlc4TlEJx0f7qFyN XJ4Ki9vmJHJ4ddN/G+n3MtvqBXcUIl4C3ju6G+FQfTX5nzfQMCFBVGgeZJKrVrg3 68gshJjbM88lqN+IqzcBMrfVGqwcEOmmw+T5tSNeGgsQssO8Nbg3g= Received: (qmail 92812 invoked by alias); 4 Jun 2016 12:12:29 -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 92796 invoked by uid 89); 4 Jun 2016 12:12:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=!in_gcov_tool, sk:__gcov, sk:!__gcov, gcov-aware X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 04 Jun 2016 12:12:18 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14A0EA70D; Sat, 4 Jun 2016 12:12:17 +0000 (UTC) Received: from aconole-fed23 (vpn-57-142.rdu2.redhat.com [10.10.57.142]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u54CCEsa003680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Jun 2016 08:12:16 -0400 From: Aaron Conole To: "H.J. Lu" Cc: Nathan Sidwell , GCC Patches , Jan Hubicka , Nathan Sidwell Subject: Re: [PATCH v2] gcov: Runtime configurable destination output References: <1456350732-8272-1-git-send-email-aconole@bytheb.org> <8040ea19-7c4f-03ab-ba90-d82b35abcb32@acm.org> Date: Sat, 04 Jun 2016 08:12:14 -0400 In-Reply-To: (H. J. Lu's message of "Fri, 3 Jun 2016 08:00:18 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes > It breaks profiledbootstrap: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71400 I am including a patch that should fix the issues introduced by my patch. I have confirmed behavior on my system, and built with profiledbootstrap as well as bootstrap. libgcc/ChangeLog: 2016-06-04 Aaron Conole * libgcov-driver-system.c (gcov_error): Remove redundant assignment. (get_gcov_error_file): Invert the IN_GCOV_TOOL test (__gcov_error_file): Only use this when !IN_GCOV_TOOL --- libgcc/libgcov-driver-system.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libgcc/libgcov-driver-system.c b/libgcc/libgcov-driver-system.c index ff8a521..6bfe6ba 100644 --- a/libgcc/libgcov-driver-system.c +++ b/libgcc/libgcov-driver-system.c @@ -27,7 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see it will either be stderr, or a file of the user's choosing. Non-static to prevent multiple gcov-aware shared objects from instantiating their own copies. */ +#if !IN_GCOV_TOOL FILE *__gcov_error_file = NULL; +#endif /* A utility function to populate the __gcov_error_file pointer. This should NOT be called outside of the gcov system driver code. */ @@ -35,7 +37,7 @@ FILE *__gcov_error_file = NULL; static FILE * get_gcov_error_file(void) { -#if !IN_GCOV_TOOL +#if IN_GCOV_TOOL return stderr; #else char *gcov_error_filename = getenv ("GCOV_ERROR_FILE"); @@ -60,11 +62,8 @@ gcov_error (const char *fmt, ...) int ret; va_list argp; - if (!__gcov_error_file) - __gcov_error_file = get_gcov_error_file (); - va_start (argp, fmt); - ret = vfprintf (__gcov_error_file, fmt, argp); + ret = vfprintf (get_gcov_error_file (), fmt, argp); va_end (argp); return ret; }