From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE8D9385841D; Fri, 20 Oct 2023 19:37:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE8D9385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697830665; bh=c6K24IPgfEWaDsku9labHw3n7qVjs+p9qMhrUKPQ2tc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IzG1mOMt8ORxI8pTK15wnvDR9c2lr0SvzUisulq7JBb0lkWaJKHlIgXfxd6p7B7r7 pePtmd1T1xqpvrbK34dmYXtHs1pJL7QGhGOPg35NUjq7Mj1mi0gMciFfxb+QwADGuj dzDJehjjPfmg3CGmJ4QccnyhQzL0bB9FvMtZRFhI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111884] [13/14 Regression] unsigned char no longer aliases anything under -std=c2x Date: Fri, 20 Oct 2023 19:37:45 +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: 13.2.1 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D111884 --- Comment #5 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:281699fbff6262766674ab13087d37db751cd40a commit r14-4802-g281699fbff6262766674ab13087d37db751cd40a Author: Marek Polacek Date: Thu Oct 19 16:32:10 2023 -0400 c-family: char8_t and aliasing in C vs C++ [PR111884] In the PR, Joseph says that in C char8_t is not a distinct type. So we should behave as if it can alias anything, like ordinary char. In C, unsigned_char_type_node =3D=3D char8_type_node, so with this patch we return 0 instead of -1. And the following comment says: /* The C standard guarantees that any object may be accessed via an lvalue that has narrow character type (except char8_t). */ if (t =3D=3D char_type_node || t =3D=3D signed_char_type_node || t =3D=3D unsigned_char_type_node) return 0; Which appears to be wrong, so I'm adjusting that as well. PR c/111884 gcc/c-family/ChangeLog: * c-common.cc (c_common_get_alias_set): Return -1 for char8_t o= nly in C++. gcc/testsuite/ChangeLog: * c-c++-common/alias-1.c: New test.=