public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Alexandre Oliva <oliva@adacore.com>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org, Nathan Sidwell <nathan@acm.org>,
	Eric Botcazou <ebotcazou@adacore.com>,
	"Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: [PATCH v6] Introduce attribute sym_alias
Date: Thu, 30 Nov 2023 16:24:18 +0100	[thread overview]
Message-ID: <ZWipIg5arDhvSKIW@kam.mff.cuni.cz> (raw)
In-Reply-To: <orwmtzz9l3.fsf_-_@lxoliva.fsfla.org>

> On Nov 22, 2023, Jan Hubicka <hubicka@ucw.cz> 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

  reply	other threads:[~2023-11-30 15:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 20:56 [RFC, WIP] introduce attribute exalias Alexandre Oliva
2020-08-07 17:38 ` [PATCH] " Alexandre Oliva
2020-08-14 15:39   ` Alexandre Oliva
2020-08-14 16:24     ` Nathan Sidwell
2020-08-14 19:24       ` Alexandre Oliva
2020-08-14 22:12         ` Nathan Sidwell
2020-08-15  2:43           ` Alexandre Oliva
2020-08-15  9:22             ` Iain Sandoe
2020-08-15 16:39               ` Alexandre Oliva
2020-08-15 18:17                 ` Iain Sandoe
2020-08-25  8:34                   ` Alexandre Oliva
2020-08-25 11:23                     ` Iain Sandoe
2020-08-15 17:26               ` Alexandre Oliva
2020-08-15 21:11             ` Nathan Sidwell
2020-08-25  7:50               ` Alexandre Oliva
2023-07-15  1:08   ` [PATCH v3] Introduce attribute reverse_alias Alexandre Oliva
2023-07-15 21:55     ` Nathan Sidwell
2023-07-18  4:29       ` Alexandre Oliva
2023-07-18 11:37         ` Richard Biener
2023-07-19 23:11           ` [PATCH v4] Introduce attribute sym Alexandre Oliva
2023-07-20 13:09             ` Richard Biener
2023-07-21  9:23               ` Alexandre Oliva
2023-07-22  3:12             ` Fangrui Song
2023-08-16  4:27               ` Alexandre Oliva
     [not found]             ` <orpm2tgrsd.fsf_-_@lxoliva.fsfla.org>
     [not found]               ` <CAH6eHdQ3vT3MjohuE-izto+K=BMRykY3T-UyWa5-=OTDPM-JsQ@mail.gmail.com>
     [not found]                 ` <ory1h9t6nr.fsf@lxoliva.fsfla.org>
2023-09-20  5:59                   ` [PATCH v5] Introduce attribute sym_alias (was: Last call for bikeshedding on attribute sym/exalias/reverse_alias) Alexandre Oliva
2023-11-20 12:54                     ` [PATCH v5] Introduce attribute sym_alias Alexandre Oliva
2023-11-22 12:14                       ` Richard Biener
2023-11-22 19:16                         ` Joseph Myers
2023-11-22 13:13                     ` [PATCH v5] Introduce attribute sym_alias (was: Last call for bikeshedding on attribute sym/exalias/reverse_alias) Jan Hubicka
2023-11-30 12:53                       ` [PATCH v6] Introduce attribute sym_alias Alexandre Oliva
2023-11-30 15:24                         ` Jan Hubicka [this message]
2023-12-01 11:25                           ` [PATCH v7] " Alexandre Oliva
2023-12-06  2:10                             ` [PATCH v8] " Alexandre Oliva
2023-12-06 10:06                             ` [PATCH v7] " Jan Hubicka
2023-12-07 20:52                               ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWipIg5arDhvSKIW@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=jwakely.gcc@gmail.com \
    --cc=nathan@acm.org \
    --cc=oliva@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).