public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103615] New: [8/9 Regression] wrong code with "-O3" or "-O1 -ftree-vectorize" on x86_64-pc-linux-gnu
@ 2021-12-08  9:15 siarhei.siamashka at gmail dot com
  2021-12-08  9:17 ` [Bug tree-optimization/103615] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: siarhei.siamashka at gmail dot com @ 2021-12-08  9:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103615

            Bug ID: 103615
           Summary: [8/9 Regression] wrong code with "-O3" or "-O1
                    -ftree-vectorize" on x86_64-pc-linux-gnu
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: siarhei.siamashka at gmail dot com
  Target Milestone: ---

A reduced testcase from https://codeforces.com/blog/entry/97433

$ cat test.c
int z = 5;
int a[6] = {0, 0, 0, 0, 0, 1};
int main() {
  for (int x = 5; x; x--)
    for (int y = z; y >= x; y--)
      a[y - x] += a[y];
  if (a[0] != 7)
    __builtin_abort ();
  return 0;
}

$ gcc-7.3.0 -O3 test.c && ./a.out

$ gcc-8.3.0 -O3 test.c && ./a.out
Aborted

$ gcc-9.3.0 -O3 test.c && ./a.out
Aborted

$ gcc-9.4.1 -O3 test.c && ./a.out
Aborted

$ gcc-10.3.0 -O3 test.c && ./a.out

Only GCC versions 8.x and 9.x are affected and the bug is triggered by "-O3" or
"-O1 -ftree-vectorize" optimization option.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-27  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  9:15 [Bug tree-optimization/103615] New: [8/9 Regression] wrong code with "-O3" or "-O1 -ftree-vectorize" on x86_64-pc-linux-gnu siarhei.siamashka at gmail dot com
2021-12-08  9:17 ` [Bug tree-optimization/103615] " pinskia at gcc dot gnu.org
2021-12-08  9:21 ` [Bug tree-optimization/103615] [9 " marxin at gcc dot gnu.org
2022-01-03  8:57 ` cvs-commit at gcc dot gnu.org
2022-01-03 12:14 ` rguenth at gcc dot gnu.org
2022-01-08 10:55 ` pinskia at gcc dot gnu.org
2022-05-27  9:52 ` rguenth at gcc dot gnu.org

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).