From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 4AC643858D35 for ; Mon, 23 Aug 2021 12:02:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4AC643858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id ED5B92809AC; Mon, 23 Aug 2021 14:02:46 +0200 (CEST) Date: Mon, 23 Aug 2021 14:02:46 +0200 From: Jan Hubicka To: Richard Biener Cc: Martin =?iso-8859-2?Q?Li=B9ka?= , GCC Patches Subject: Re: [PATCH] IPA: MODREF should skip EAF_* flags for indirect calls Message-ID: <20210823120246.GI68480@kam.mff.cuni.cz> References: <7d70a502-f714-77d1-f790-995e245b9ab2@suse.cz> <20210822123806.GF81418@kam.mff.cuni.cz> <20210822173214.GF68480@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 12:02:58 -0000 Hi, > > Why does it "punish" -fno-ipa-pta? It merely "punishes" modref of > no longer claiming that we do not alter the instruction stream pointed > to by a->foo, sth that shouldn't be very common. For example struct a { void (*foo)(); void *bar; } fn(struct a *a) { a->foo(); } With Maritn's patch we will drop EAF flags of A to NODIRECTESCAPE since we will think its derefernece is is used in all posible ways. With my patch we get NOT_RETURNED | NOESCAPE. Still we will make PTA to think that whatever is pointed to by bar may be clobbered and this seems unnecessary. I have to look into ipa-pta how it haldnes the "instruction stream clobbering". I was not aware it does something smart about indirect calls. Honza