public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "weilercdale at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/115056] [14/15 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) when -O2 or higher Date: Mon, 13 May 2024 01:51:39 +0000 [thread overview] Message-ID: <bug-115056-4-RfnUhaOuap@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-115056-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 --- Comment #10 from Dale Weiler <weilercdale at gmail dot com> --- New test case without UB still exhibits the behavior #include <string.h> #include <stdio.h> typedef union { unsigned char as_bytes[64]; unsigned long long as_chunks[64 / sizeof(unsigned long long)]; } Block; int main(int argc, char **argv) { Block block; int i = strlen(argv[0]), j = 0; for (; j < i; j++) block.as_bytes[j] = argv[0][j]; block.as_bytes[j] = 0x01; while (++j & 7) block.as_bytes[j] = 0; if (j > 56) while (j < 64) block.as_bytes[j++] = 0; while (j < 56) block.as_bytes[j++] = 0; while (j < 64) block.as_bytes[j++] = 0x01; for (j = 0; j < 8; j++) printf("%d\n", (int)block.as_chunks[j]); }
next prev parent reply other threads:[~2024-05-13 1:51 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-12 23:27 [Bug rtl-optimization/115056] New: Miscompilation triggering -Wstringop-overflow and -Warray-bounds warning " weilercdale at gmail dot com 2024-05-12 23:29 ` [Bug rtl-optimization/115056] [14 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) " sjames at gcc dot gnu.org 2024-05-12 23:32 ` sjames at gcc dot gnu.org 2024-05-12 23:34 ` weilercdale at gmail dot com 2024-05-12 23:35 ` sjames at gcc dot gnu.org 2024-05-12 23:38 ` weilercdale at gmail dot com 2024-05-12 23:39 ` sjames at gcc dot gnu.org 2024-05-13 0:57 ` [Bug rtl-optimization/115056] [14/15 " sjames at gcc dot gnu.org 2024-05-13 1:14 ` weilercdale at gmail dot com 2024-05-13 1:18 ` sjames at gcc dot gnu.org 2024-05-13 1:18 ` sjames at gcc dot gnu.org 2024-05-13 1:51 ` weilercdale at gmail dot com [this message] 2024-05-13 9:49 ` rguenth at gcc dot gnu.org 2024-05-20 7:39 ` [Bug middle-end/115056] [14/15 regression] False positive -Wstringop-overflow and -Warray-bounds sjames 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-115056-4-RfnUhaOuap@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).