From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D84FC3858C2A; Thu, 2 Nov 2023 12:40:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D84FC3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698928839; bh=gBZspVQbZzC2aH2fF7aPi/0odoACNEA7REd2i/u8liU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q9We4/0bxuACGzePWi2sOf3EZzrNe0G6vqDkf7D5mYk85oY3Ovfs3/OhX4hB+sCmu mKlsbWHkWarqPaFh7RgcLOvFWl65qg2VKV8T3oiPQ5UiZJEvsGyZ8jfIcbCpbe7g/P hd8aSRx2RhqdtsQmzALzIKigjOUIjtb3c9J8H8GY= From: "jwjagersma at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/69549] Named Address Spaces does not compile in C++ Date: Thu, 02 Nov 2023 12:40:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: patch X-Bugzilla-Severity: normal X-Bugzilla-Who: jwjagersma at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69549 --- Comment #12 from jwjagersma at gmail dot com --- (In reply to Xi Ruoyao from comment #11) > Generally a patch should be sent to gcc-patches@gcc.gnu.org. See > https://gcc.gnu.org/contribute.html. The patches attached to a Bugzilla > ticket are considered prototypes and for discussion only. This patch isn't complete yet, I posted it here in hopes of receiving some comments. It works for simple structs that are managed externally (eg, from inline asm). But other than that it doesn't integrate with the C++ type sy= stem so well. There is no way to make AS-qualified ctors/dtors (in fact, calling a dtor o= n an AS-qualified ptr/ref is currently allowed - that's very bad), and also no placement-new for AS-qualified pointers. Granted, I don't think clang implements that either, but it does provide st= uff like __builtin_memcpy(). That is missing from this patch. I also recall running into one bug where it generated code to access a stack variable via fs:[esp]. I think it was something to do with rvalue referenc= es? But it disappeared when I attempted to write a smaller test case, couldn't figure that one out.=