public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kristian.klausen at scoutdi dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98932] New: Wrong output with -O3 on aarch64 Date: Tue, 02 Feb 2021 13:20:35 +0000 [thread overview] Message-ID: <bug-98932-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98932 Bug ID: 98932 Summary: Wrong output with -O3 on aarch64 Product: gcc Version: 8.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kristian.klausen at scoutdi dot com Target Milestone: --- Hi, I have been struggling with a vectorization issue, and have managed to re-create to a minimal example as attached. When compiled with `-O2` the correct output is produced, however when compiled with `-O3` the output is bogus when compiled with gcc-8 and gcc-9. Gcc-7 gives the correct output. Tested with the following versions under qemu for aarch64: ``` g++-7 --version g++-7 (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0 g++-8 --version g++-8 (Ubuntu/Linaro 8.4.0-3ubuntu2) 8.4.0 g++-9 --version g++-9 (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 ``` Output: ``` :~# g++-9 -O3 a.cpp && ./a.out Length is: 26348240 :~# g++-8 -O3 a.cpp && ./a.out Length is: 26348240 :~# g++-7 -O3 a.cpp && ./a.out Length is: 294 ``` Also gave it a go with the suggested flags before filing the report: ``` g++-8 -O3 -Wall -Wextra -fno-strict-aliasing -fwrapv a.cpp && ./a.out Length is: 26348240 ``` The code gives the correct output with gcc-10: ``` g++-10 -O3 a.cpp && ./a.out Length is: 294 g++-10 --version g++-10 (Ubuntu 10.2.0-5ubuntu1~20.04) 10.2.0 ``` Let me know if I can provide more information. Best, Kristian
next reply other threads:[~2021-02-02 13:20 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-02 13:20 kristian.klausen at scoutdi dot com [this message] 2021-02-02 13:21 ` [Bug c++/98932] " kristian.klausen at scoutdi dot com 2021-02-02 13:24 ` marxin at gcc dot gnu.org 2021-02-02 18:42 ` [Bug tree-optimization/98932] " marxin at gcc dot gnu.org 2021-02-03 8:25 ` rguenth at gcc dot gnu.org 2021-02-05 11:15 ` kristian.klausen at scoutdi dot com 2021-02-05 11:36 ` marxin at gcc dot gnu.org 2021-02-05 11:45 ` kristian.klausen at scoutdi dot com
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-98932-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).