public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "heckflosse67 at gmx dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96133] New: x86-64 gcc 10.1 using -O3 leads to wrong calculation Date: Thu, 09 Jul 2020 11:38:23 +0000 [thread overview] Message-ID: <bug-96133-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96133 Bug ID: 96133 Summary: x86-64 gcc 10.1 using -O3 leads to wrong calculation Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: heckflosse67 at gmx dot de Target Milestone: --- Here's a simple example which works fine in gcc up to version 9 when build using -O3 On gcc 10 -O3, the output is different to the output of gcc 10 -O2. The output of gcc 10 -O2 is the same as of gcc 9.3 -O3 and gcc 9.3 -O2 Using gcc 10 -O3 -fno-tree-loop-vectorize it also works fine. ``` #include <iostream> constexpr double xyz_sRGB[3][3] = { {0.4360747, 0.3850649, 0.1430804}, {0.2225045, 0.7168786, 0.0606169}, {0.0139322, 0.0971045, 0.7141733} }; int main() { double rgb_cam[3][3] = {{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, {7.0, 8.0, 9.0}}; double xyz_cam[3][3] = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) for (int k = 0; k < 3; k++) { xyz_cam[i][j] += xyz_sRGB[i][k] * rgb_cam[k][j]; } for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) { std::cout << xyz_cam[i][j] << std::endl; } return 0; } ```
next reply other threads:[~2020-07-09 11:38 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-09 11:38 heckflosse67 at gmx dot de [this message] 2020-07-09 12:01 ` [Bug c++/96133] [10/11 Regression] x86-64 gcc 10.1 using -O3 leads to wrong calculation since r10-1882-g831e688af50c5f77 marxin at gcc dot gnu.org 2020-07-09 12:06 ` rguenth at gcc dot gnu.org 2020-07-09 12:06 ` [Bug tree-optimization/96133] " rguenth at gcc dot gnu.org 2020-07-09 12:13 ` rguenth at gcc dot gnu.org 2020-07-09 12:18 ` rguenth at gcc dot gnu.org 2020-07-09 17:54 ` cvs-commit at gcc dot gnu.org 2020-07-09 17:55 ` rguenth at gcc dot gnu.org 2020-07-09 19:33 ` heckflosse67 at gmx dot de 2020-07-10 7:30 ` rguenth at gcc dot gnu.org 2020-07-10 8:53 ` cvs-commit at gcc dot gnu.org 2020-07-10 10:38 ` [Bug tree-optimization/96133] [10 " cvs-commit at gcc dot gnu.org 2020-07-10 10:38 ` rguenth at gcc dot gnu.org 2020-07-10 11:36 ` heckflosse67 at gmx dot de
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-96133-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).