public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@kam.mff.cuni.cz>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jason Merrill <jason@redhat.com>,
	Jonathan Wakely <jwakely@redhat.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++, symtab: Support &typeid(x) == &typeid(y) in constant evaluation [PR103600]
Date: Thu, 9 Dec 2021 21:41:40 +0100	[thread overview]
Message-ID: <20211209204140.GA67389@kam.mff.cuni.cz> (raw)
In-Reply-To: <20211209201523.GK2646553@tucnak>

> 
> Ah, indeed, good idea.  FYI, clang++ seems to constant fold
> &typeid(x) != &typeid(y) already, so Jonathan could use it even for
> clang++ in the constexpr operator==.  But it folds even
> extern int &a, &b;
> constexpr bool c = &a != &b;
> regardless of whether some other TU has
> int a;
> int b __attribute__((alias (a));
> or not.
> 
> Here is an updated patch, ok for trunk if it passes bootstrap/regtest?

Looks good to me.  We are somewhat inconsistent on when we support
overleap and when we don't.  Also we produce local symbols that can be
later globalized by partitioning.  So perhaps we want this to eventually
become flag in symtab node and unify the logic in aliasing code etc, but
that can wait for next stage1.

Honza

  reply	other threads:[~2021-12-09 20:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 10:35 [PATCH] c++: Support &typeid(x) == &typeid(y) and typeid(x) == typeid(y) " Jakub Jelinek
2021-12-08 13:53 ` Jason Merrill
2021-12-08 13:56   ` Jonathan Wakely
2021-12-09 20:15   ` [PATCH] c++, symtab: Support &typeid(x) == &typeid(y) " Jakub Jelinek
2021-12-09 20:41     ` Jan Hubicka [this message]
2021-12-09 23:09     ` Jason Merrill
2021-12-10 10:41       ` [PATCH] symtab: Fold &a == &b to 0 if folding_initializer [PR94716] Jakub Jelinek

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=20211209204140.GA67389@kam.mff.cuni.cz \
    --to=hubicka@kam.mff.cuni.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=jwakely@redhat.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).