From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88163 invoked by alias); 27 Mar 2015 09:37:14 -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 88153 invoked by uid 89); 27 Mar 2015 09:37:13 -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; Fri, 27 Mar 2015 09:37:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2R9bAgi032347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 27 Mar 2015 05:37:11 -0400 Received: from tucnak.zalov.cz (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2R9b8LO023331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Mar 2015 05:37:10 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t2R9b7FF001102; Fri, 27 Mar 2015 10:37:07 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t2R9b5R9001101; Fri, 27 Mar 2015 10:37:05 +0100 Date: Fri, 27 Mar 2015 09:37:00 -0000 From: Jakub Jelinek To: Andreas Krebbel Cc: gcc-patches@gcc.gnu.org, vogt@linux.vnet.ibm.com Subject: Re: [PATCH] S390: Hotpatching fixes. Message-ID: <20150327093705.GK1746@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> <20150326205630.GH1746@tucnak.redhat.com> <5515233E.2010406@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5515233E.2010406@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01419.txt.bz2 On Fri, Mar 27, 2015 at 10:30:38AM +0100, Andreas Krebbel wrote: > At a second glance it is not really clear to me why we disable hotpatching for nested functions at > all. While it is probably a bit difficult to actually hotpatch them I don't see why we should > prevent it. We probably just copied that over from the x86 ms_hook_prologue attribute implementation: > > static bool > ix86_function_ms_hook_prologue (const_tree fn) > { > if (fn && lookup_attribute ("ms_hook_prologue", DECL_ATTRIBUTES (fn))) > { > if (decl_function_context (fn) != NULL_TREE) > error_at (DECL_SOURCE_LOCATION (fn), > "ms_hook_prologue is not compatible with nested function"); > else > return true; > } > return false; > } > > Also the kernel guys (one of the main users of that feature) confirmed that they in principle prefer > hotpatching to behave more like -pg and -pg does insert an mcount call for nested functions. > (Although I would be surprised to hear of nested functions in the Linux kernel). > > So I'm inclined to just remove that special handling of nested functions. Agreed, I also wondered what would be so special about nested functions here. Sure, one could hotpatch them with code clobbering the static chain register, but that wouldn't be a gcc issue. Jakub