public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "zhendong.su at inf dot ethz.ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102446] New: wrong code at -O3 on x86_64-linux-gnu Date: Wed, 22 Sep 2021 09:00:55 +0000 [thread overview] Message-ID: <bug-102446-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102446 Bug ID: 102446 Summary: wrong code at -O3 on x86_64-linux-gnu Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- This seems to be a long-latent miscompilation, affecting GCC 5.1 and later. [583] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210922 (experimental) [master r12-3777-g578b7687338] (GCC) [584] % [584] % gcctk -O2 small.c; ./a.out [585] % [585] % gcctk -O3 small.c [586] % ./a.out Segmentation fault [587] % [587] % cat small.c int a = 1, c, e, f, *j, k, o, *r = &f, s; char b, l; short d, *g; unsigned h; static void m(void); static void n(int); void p(int *q) { while (1) { if (*q) break; if (*g) o = c; while (l) ; } } void t() { for (; s < 8; s++) m(); } void m() { int aa = 0, i = 0; for (; i < 3; i++) if (k < 0) aa |= *j; if (d) c = (h + *g + 2) & c; n(aa); } void n(int ac) { char *ad = &b, u = ac, *v = &b; int ae = *ad = a; u && (*v = e > 0); *r = c; p(&ae); } int main() { t(); return 0; }
next reply other threads:[~2021-09-22 9:00 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-22 9:00 zhendong.su at inf dot ethz.ch [this message] 2021-09-22 10:50 ` [Bug tree-optimization/102446] " rguenth at gcc dot gnu.org 2021-09-22 10:54 ` [Bug tree-optimization/102446] [9/10/11/12 Regression] " jakub at gcc dot gnu.org 2021-09-22 10:56 ` Jan Hubicka 2021-09-22 10:56 ` rguenth at gcc dot gnu.org 2021-09-22 10:56 ` hubicka at ucw dot cz 2021-09-22 10:57 ` [Bug rtl-optimization/102446] " rguenth at gcc dot gnu.org 2021-09-22 10:57 ` rguenth at gcc dot gnu.org 2021-09-22 11:01 ` jakub at gcc dot gnu.org 2021-09-22 11:02 ` jakub at gcc dot gnu.org 2021-09-22 11:11 ` pinskia at gcc dot gnu.org 2021-09-22 11:29 ` jakub at gcc dot gnu.org 2022-01-30 2:04 ` pinskia at gcc dot gnu.org 2022-01-30 12:34 ` jakub at gcc dot gnu.org 2022-01-30 20:48 ` pinskia at gcc dot gnu.org 2022-05-27 9:46 ` [Bug rtl-optimization/102446] [10/11/12/13 " rguenth at gcc dot gnu.org 2022-06-28 10:46 ` jakub at gcc dot gnu.org 2022-07-29 12:22 ` [Bug rtl-optimization/102446] [10/11 " rguenth at gcc dot gnu.org 2022-07-29 12:44 ` jakub at gcc dot gnu.org 2022-07-29 12:45 ` jakub at gcc dot gnu.org 2023-07-07 10:41 ` [Bug rtl-optimization/102446] [11 " rguenth 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-102446-4@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).