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 389ED3858D32 for ; Thu, 30 Nov 2023 15:24:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 389ED3858D32 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kam.mff.cuni.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 389ED3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.113.20.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701357862; cv=none; b=P2w1zOzZA6Z5O+xk/uF7pO3zI0pBsryCj2N0pl6boZdKLvVtAJIWFD+UFCBtht65+90R1XgOvBxDVxT4QQNsnbyT/mC/wKu52kkNCYykduX4yx/Reuti8Be+7VpZ9FjbKjd9/WPFiMDsQZL5dP96xl99LzYbtkSNIOkCPrqXCp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701357862; c=relaxed/simple; bh=ZyJvRnOTzuTxearxd3d8LsHal/YaudC6v2irF/SeUg8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=jQ/9tSIBukE3GgdN5NIcbnrPpCOQd1Lkzvo1kxOHf5anH0psHwIE5YiZLN9ol1BlMy3buXlMbQeFkjvWQIS76dwjl5ZymvGoZhLo2Jm+e5VjE+kn7afkxFFVCHsxKwGh87xLRsOQveTPcb+5E3Se3EVbCRyK5LZHgwG+OLCItb4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 6C04228BD21; Thu, 30 Nov 2023 16:24:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1701357858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A1ZeS6DTjuoz05CEM4Ma+5xXPh01cRUbEqNCBTwvLro=; b=gjAExgBpfD1e8DVbOBYKzraXCsJrCjIG+DKrKUhBJB+vGNpql4t/QnUJhgpReR002SzbqP flef3SkLG059q5Jvj4RgwmyIo5m2HeGqDTSY0LK7WYvGZSeV1P88Cjb7jRtGPFE92uI1nd HlX/siolvgbcHU+Cty3qN4E9JqMdlGM= Date: Thu, 30 Nov 2023 16:24:18 +0100 From: Jan Hubicka To: Alexandre Oliva Cc: Jonathan Wakely , gcc-patches@gcc.gnu.org, Nathan Sidwell , Eric Botcazou , "Joseph S. Myers" Subject: Re: [PATCH v6] Introduce attribute sym_alias 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=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On Nov 22, 2023, Jan Hubicka wrote: > > > I wonder why you use same body aliases, which are kind of special to C++ > > frontend (and come with fixup code working around its quirks you had to > > disable above). > > TBH, I don't recall whether I had any reason to have gone down that > path, or I just didn't realize I could have done something simpler. > I've worked on and off on this patch for the past 3.5y, so many details > have faded away from memory by now. I do recall there were some > challenges in making the sym_alias name available as an alias target > early enough for it to be found, and this may have been related with > these odd choices back then. But the good news is that calling > create_alias works just fine. I'm suppose that creating alias > attributes would as well, but why bother? This looks even clearner! > Thanks! > diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc > index bccd2f2abb5a3..eb2d05094e989 100644 > --- a/gcc/cgraphunit.cc > +++ b/gcc/cgraphunit.cc > @@ -1175,7 +1175,7 @@ analyze_functions (bool first_time) > C++ FE is confused about the COMDAT groups being right. */ > if (symtab->cpp_implicit_aliases_done) > FOR_EACH_SYMBOL (node) > - if (node->cpp_implicit_alias) > + if (node->cpp_implicit_alias && node->analyzed) I think you hould be able to drop this, since aliases you create now are not same body aliases. > + if (VAR_P (replaced)) > + varpool_node::create_alias (sym_node->decl, replacement); > + else > + cgraph_node::create_alias (sym_node->decl, replacement); We probably chould have create_alias on symbol node directly, but that is something I can clean up next stage1. The IPA bits are fine. I will take a look on your second patch. Honza