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 EADAB3858C27 for ; Thu, 9 Dec 2021 20:41:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EADAB3858C27 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id BDC53281EAA; Thu, 9 Dec 2021 21:41:40 +0100 (CET) Date: Thu, 9 Dec 2021 21:41:40 +0100 From: Jan Hubicka To: Jakub Jelinek Cc: Jason Merrill , Jonathan Wakely , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++, symtab: Support &typeid(x) == &typeid(y) in constant evaluation [PR103600] Message-ID: <20211209204140.GA67389@kam.mff.cuni.cz> References: <20211208103528.GE2646553@tucnak> <20211209201523.GK2646553@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211209201523.GK2646553@tucnak> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-5.6 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, 09 Dec 2021 20:41:43 -0000 > > 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