From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17374 invoked by alias); 9 Jan 2019 11:28:01 -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 15758 invoked by uid 89); 9 Jan 2019 11:28:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:4dfc, qingzhaooraclecom, U*qing.zhao, sk:qing.zh X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 11:27:58 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5206FAE3E; Wed, 9 Jan 2019 11:27:56 +0000 (UTC) Subject: Re: Question on Disable no throw for -flive-patching master option. From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: Qing Zhao , Jan Hubicka Cc: gcc Patches References: <8F7AEFF2-5DCE-49B6-BC9E-34FC0DEF2A55@oracle.com> <568496ae-!24cf-7453-57db-a2188d5d11c2@suse.cz> <49B97110-C7FD-4569-AE26-1B37951D802B@oracle.com> <30e99713-0a96-3acb-ea5f-8f0996be69a6@suse.cz> <5A3304F6-2084-44BA-86CB-88A657AAF741@oracle.com> <25de1f37-40b1-1834-78cc-13f89215906d@suse.cz> <06EEEEBB-40EC-47DE-BB30-22784E3E28AF@oracle.com> <20181128155203.rusncos2kiieyqgk@kam.mff.cuni.cz> <08E2AFA4-EBEF-4DA3-8DB1-B5603D43BAEC@oracle.com> <92cb213a-7cab-70f4-38e4-57e61259f6dd@suse.cz> Message-ID: <69288aa5-93f4-bc64-4dfc-da0f5ea9b0e0@suse.cz> Date: Wed, 09 Jan 2019 11:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <92cb213a-7cab-70f4-38e4-57e61259f6dd@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00475.txt.bz2 Honza: PING^2 On 1/2/19 12:47 PM, Martin Liška wrote: > Honza: PING > > On 12/6/18 12:16 AM, Qing Zhao wrote: >> Hi, Honza, >> >> I have one question relate to whether to disable nothrow for -flive-patching as following: >> >> actually, there are two passes here: >> >> 1. local nothrow pass:  in this pass, nothrow attribute is set locally after analyzing every stmt of the function >> body:  >> >> unsigned int >> pass_nothrow::execute (function *) >> { >>   struct cgraph_node *node; >>   basic_block this_block; >> … >> >> } >> >> 2. nothrow propagation pass:  (it’s included in the ipa_pure_const pass as following, propagate the nothrow  >> attribute along callcgraph) >> >> unsigned int >> pass_ipa_pure_const:: >> execute (function *) >> { >>   bool remove_p; >> >>   /* Nothrow makes more function to not lead to return and improve >>      later analysis.  */ >>   propagate_nothrow (); >>   propagate_malloc (); >>   remove_p = propagate_pure_const (); >> >>   delete funct_state_summaries; >>   return remove_p ? TODO_remove_functions : 0; >> } >> >> the nothrow propagation pass is included in ipa_pure_const pass, and is guarded by flag_ipa_pure_const,  >> this flag_ipa_pure_const is disabled when -flive-patching is ON. >> >> >> So, my question is: >> >> shall we disable local nothrow pass as well when -flive-patching is ON? >> >> my understanding is: we should.  >> >> the reason is:   the local nothrow pass is setting the nothrow attribute for the current routine based on its >> body,  and this “nothrow” attribute will be used  when generating EH code around callsite from the caller >> of the routine. so the nothrow attribute might impact other routines than the current routine.  as a result, >> we should disable this pass? >> >> what’s your opinion on this? >> >> thanks. >> >> Qing >> >>> On Nov 28, 2018, at 2:24 PM, Qing Zhao > wrote: >>>> >>>> Shall we also disable nothrow or we will worry about C++ only ter? >>> >>> This is also mainly for C++ applications, so currently should not be a problem. >>> But I can add a separate simple patch to add another flag to control nothrow propagation and disable it when -flive-patching is ON. >>> >>>> >>>> Patch is OK, >>> >>> thanks for the review. >>> >>> I will commit the patch very soon. >>> >>> Qing >>>> thanks! >>>> Honza >>