public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107160] [13 regression] r13-2641-g0ee1548d96884d causes verification failure in spec2006 Date: Thu, 13 Oct 2022 12:01:43 +0000 [thread overview] Message-ID: <bug-107160-4-BaP1NCiimA@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107160-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107160 --- Comment #13 from Martin Liška <marxin at gcc dot gnu.org> --- A bit reduced test-case that can be compiled with cross compiler: $ cat pr107160.c #define N 16 float fl[N]; __attribute__ ((noipa, optimize (0))) void init () { for (int i = 0; i < N; i++) fl[i] = 1 << i; } __attribute__ ((noipa)) float foo (int n) { float sum0, sum1, sum2, sum3; sum0 = sum1 = sum2 = sum3 = 0.0f; for (int i = 0; i < n; i += 4) { sum0 += __builtin_fabs (fl[i]); sum1 += __builtin_fabs (fl[i + 1]); sum2 += __builtin_fabs (fl[i + 2]); sum3 += __builtin_fabs (fl[i + 3]); } return sum0 + sum1 + sum2 + sum3; } __attribute__ ((optimize (0))) int main () { init (); float res = foo (N); __builtin_printf ("res:%f\n", res); return 0; } x86_64: ./a.out res:65535.000000 ppc64le: ./a.out res:15.000000 so the result is wrong, it sums only first 4 elements (and not 16).
next prev parent reply other threads:[~2022-10-13 12:01 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-05 16:21 [Bug target/107160] New: " seurer at gcc dot gnu.org 2022-10-06 10:43 ` [Bug target/107160] " rguenth at gcc dot gnu.org 2022-10-06 14:04 ` seurer at gcc dot gnu.org 2022-10-06 19:08 ` seurer at gcc dot gnu.org 2022-10-10 2:29 ` linkw at gcc dot gnu.org 2022-10-10 19:14 ` seurer at gcc dot gnu.org 2022-10-12 8:31 ` linkw at gcc dot gnu.org 2022-10-13 9:57 ` linkw at gcc dot gnu.org 2022-10-13 10:16 ` rguenth at gcc dot gnu.org 2022-10-13 10:31 ` linkw at gcc dot gnu.org 2022-10-13 11:05 ` rguenther at suse dot de 2022-10-13 11:45 ` linkw at gcc dot gnu.org 2022-10-13 11:50 ` rguenther at suse dot de 2022-10-13 12:01 ` marxin at gcc dot gnu.org [this message] 2022-10-13 12:05 ` rguenth at gcc dot gnu.org 2022-10-13 12:23 ` rguenth at gcc dot gnu.org 2022-10-13 13:17 ` cvs-commit at gcc dot gnu.org 2022-10-13 13:19 ` [Bug target/107160] [12/13 " rguenth at gcc dot gnu.org 2022-10-14 2:54 ` [Bug target/107160] [12 " linkw at gcc dot gnu.org 2022-10-17 13:10 ` cvs-commit at gcc dot gnu.org 2022-10-17 13: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-107160-4-BaP1NCiimA@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).