public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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:40:42 +0000 [thread overview] Message-ID: <bug-111884-4-UgsOBBqo0j@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-111884-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111884 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:4f93c6027fb09c94ca8dc7fe13f92a3b9205b68a commit r13-7967-g4f93c6027fb09c94ca8dc7fe13f92a3b9205b68a Author: Marek Polacek <polacek@redhat.com> 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 == 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 == char_type_node || t == signed_char_type_node || t == 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 only in C++. gcc/testsuite/ChangeLog: * c-c++-common/alias-1.c: New test. (cherry picked from commit 281699fbff6262766674ab13087d37db751cd40a)
next prev parent reply other threads:[~2023-10-20 19:40 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-19 20:02 [Bug c/111884] New: " amonakov at gcc dot gnu.org 2023-10-19 20:19 ` [Bug c/111884] " sjames at gcc dot gnu.org 2023-10-19 20:23 ` joseph at codesourcery dot com 2023-10-19 20:30 ` mpolacek at gcc dot gnu.org 2023-10-19 20:39 ` [Bug c/111884] [13/14 Regression] " pinskia at gcc dot gnu.org 2023-10-19 20:57 ` tom at honermann dot net 2023-10-20 6:51 ` rguenth at gcc dot gnu.org 2023-10-20 19:37 ` cvs-commit at gcc dot gnu.org 2023-10-20 19:40 ` cvs-commit at gcc dot gnu.org [this message] 2023-10-20 19:40 ` mpolacek at gcc dot gnu.org
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=bug-111884-4-UgsOBBqo0j@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).