From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13484 invoked by alias); 26 Mar 2015 20:56:48 -0000 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 Received: (qmail 13471 invoked by uid 89); 26 Mar 2015 20:56:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Thu, 26 Mar 2015 20:56:45 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2QKuiMJ015320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Mar 2015 16:56:44 -0400 Received: from tucnak.zalov.cz (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2QKufk5006929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 Mar 2015 16:56:44 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t2QKuXda031463; Thu, 26 Mar 2015 21:56:39 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t2QKuU9Y031462; Thu, 26 Mar 2015 21:56:30 +0100 Date: Thu, 26 Mar 2015 20:56:00 -0000 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org, Andreas Krebbel Subject: Re: [PATCH] S390: Hotpatching fixes. Message-ID: <20150326205630.GH1746@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150305124019.GA6266@linux.vnet.ibm.com> <20150309112221.GA4801@linux.vnet.ibm.com> <20150309121938.GA11867@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150309121938.GA11867@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01399.txt.bz2 Hi! On Mon, Mar 09, 2015 at 01:19:38PM +0100, Dominik Vogt wrote: > @@ -11368,6 +11349,7 @@ static void > s390_reorg (void) > { > bool pool_overflow = false; > + int hw_before, hw_after; > > /* Make sure all splits have been performed; splits after > machine_dependent_reorg might confuse insn length counts. */ > @@ -11503,6 +11485,40 @@ s390_reorg (void) > if (insn_added_p) > shorten_branches (get_insns ()); > } > + > + s390_function_num_hotpatch_hw (current_function_decl, &hw_before, &hw_after); > + if (hw_after > 0) Two minor issues, both for nested functions: 1) the s390_function_num_hotpatch_hw assigns to ints whose addresses are passed as arguments, even when it later decides to return false and in this spot you ignore the return value. Which means that hw_after could be non-zero, even when you should be ignoring it. So, either you should check above the return value too, or change s390_function_num_hotpatch_hw so that it stores 0 for the nested functions before returning false. 2) as s390_function_num_hotpatch_hw is now called twice for the same function, for nested functions you'll get the warning reported twice too. Perhaps add some additional argument whether you want the warning or not and use it in one of the callers and not in the other one? Plus supposedly add testsuite coverage for that. Jakub