From patchwork Fri Sep 30 12:47:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 677031 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 3slrnD3SPMz9s3T for ; Fri, 30 Sep 2016 22:47:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=TYTndPMc; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=b4XzLgyoCbyQI6DSn 9BfF/8lPnqx2BLtp6l1e7Y5Q0F3LDdCptOBNTG7gCMwpSwsSDwfRfT7KFpkBGbF+ k6GF2323Qo90GNuEGpmn45dMKgeZb/01OlgBhICyr7F/1avRjw/MnMHMv4sQ1fI8 fbP56T/9Ny0liOBpU6qrpAYrJE= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=xzoAT65S+j46/X3uhhFa7Da 2sLs=; b=TYTndPMcPaiDlYEamBWP9yXmFvKHkHswzCjSJA7kn3ShVeW6ONDrCut zippUuNBQb+tkSHwEHk+GnzoeEEMTPYo0LjoHjWEvrLVKGtH9TmF7v4KM8bNOx4C DfI/DvlPNW3vnQ2oUBRx/ca4lAHS6ZX+o4RxIgmCdy7LggLK5N9w= Received: (qmail 22077 invoked by alias); 30 Sep 2016 12:47:19 -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 22062 invoked by uid 89); 30 Sep 2016 12:47:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 12:47:17 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CDCE9AD8E; Fri, 30 Sep 2016 12:47:15 +0000 (UTC) Subject: Re: [PATCH, RFC] gcov: dump in a static dtor instead of in an atexit handler To: Rainer Orth References: <521cd409-284b-b109-e26f-00a312eb06cc@acm.org> <447a5571-5a7c-32a6-a72d-b268af13f733@suse.cz> <5270de7f-71e7-12d0-8046-460c75005399@suse.cz> <183356f0-d8cf-ec59-8bc5-c8d7cd920092@suse.cz> <99ac0c9b-9636-3aaf-f4b7-a926c1608a1f@suse.cz> Cc: Nathan Sidwell , GCC Patches , Jan Hubicka From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 30 Sep 2016 14:47:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 09/30/2016 02:31 PM, Rainer Orth wrote: > this would be i386-pc-solaris2.12. I'm not sure if the constructor > priority detection works in a cross scenario. > > I'm attaching the resulting assembly (although for Solaris as, the gas > build is still running). Hi. Sorry, I have a stupid mistake in dtor priority (I used 65534 instead of desired 99). Please try to test it on Solaris 12 with the attached patch. I'll send the patch to ML soon. Can you please test whether it makes any change on a solaris target w/o prioritized ctors/dtors? Thanks, Martin diff --git a/gcc/coverage.c b/gcc/coverage.c index 0b8c0b3..a759831 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -1078,7 +1078,7 @@ build_gcov_exit_decl (void) append_to_statement_list (stmt, &dtor); /* Generate a destructor to run it (with priority 99). */ - cgraph_build_static_cdtor ('D', dtor, DEFAULT_INIT_PRIORITY - 1); + cgraph_build_static_cdtor ('D', dtor, MAX_RESERVED_INIT_PRIORITY - 1); } /* Create the gcov_info types and object. Generate the constructor