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 F32F43857018 for ; Thu, 28 Apr 2022 12:00:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F32F43857018 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id D6A6B282E94; Thu, 28 Apr 2022 14:00:09 +0200 (CEST) Date: Thu, 28 Apr 2022 14:00:09 +0200 From: Jan Hubicka To: Jakub Jelinek Cc: Richard Biener , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] cgraph: Don't verify semantic_interposition flag for aliases [PR105399] Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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: Thu, 28 Apr 2022 12:00:12 -0000 > On Thu, Apr 28, 2022 at 01:54:51PM +0200, Jan Hubicka wrote: > > > --- gcc/cgraph.cc.jj 2022-04-20 09:24:12.194579146 +0200 > > > +++ gcc/cgraph.cc 2022-04-27 11:53:52.102173154 +0200 > > > @@ -3488,7 +3488,9 @@ cgraph_node::verify_node (void) > > > "returns a pointer"); > > > error_found = true; > > > } > > > - if (definition && externally_visible > > > + if (definition > > > + && externally_visible > > > + && (!alias || thunk || !in_lto_p) > > > > The alias check seems OK to me. > > Why we need thunk? Here thunk may eventually gain a gimple body and we > > will be interested in its opt_for_fn flags. So if we do not set > > DECL_FUNCTION_SPECIFIC_OPTIMIZATION we may get unexpected surprises > > (such as blocked inlining). > > I've added || thunk because free_lang_data sets DECL_FUNCTION_SPECIFIC_OPTIMIZATION > for thunks, the guarding condition is: > if (gimple_has_body_p (decl) || (node && node->thunk)) > I wasn't sure if node->alias and node->thunk can be both set or not. > If they can't, I can take it out. Aha, I misread is as !alias || !thunk. But node can not be both alias and thunk, so I would leave it out. Honza > > Jakub >