public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101173] New: wrong code at -O3 on x86_64-linux-gnu
@ 2021-06-23  2:34 qrzhang at gatech dot edu
  2021-06-23  2:35 ` [Bug tree-optimization/101173] " qrzhang at gatech dot edu
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: qrzhang at gatech dot edu @ 2021-06-23  2:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101173
           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: qrzhang at gatech dot edu
  Target Milestone: ---

It affects gcc-8 to the trunk. Gcc-7.5.0 works.

$ gcc-trunk -v
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210622 (experimental) [master revision
f0e40ea0640:393ac5ed7d8:7822285515cd4dab86f722a9f4969b6952904a37] (GCC)



$ gcc-trunk abc.c ; ./a.out > 1.txt
$ gcc-trunk -O3 abc.c ; ./a.out > 2.txt

$ diff 1.txt 2.txt
11c11
< 0
---
> 8

$ cat abc.c
int a[6][9];
char b, c;
short d;
int e, f;
int main() {
  a[1][3] = 8;
  b = 1;
  for (; b <= 5; b++) {
    d = 0;
    for (; d <= 5; d++) {
      c = 0;
      for (; c <= 5; c++)
        a[b][c] = a[b][c + 2] & 216;
    }
  }
  for (; e < 6; e++) {
    f = 0;
    for (; f < 9; f++)
      printf("%d\n", a[e][f]);
  }
}

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

end of thread, other threads:[~2021-10-13 10:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  2:34 [Bug tree-optimization/101173] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2021-06-23  2:35 ` [Bug tree-optimization/101173] " qrzhang at gatech dot edu
2021-06-23  6:45 ` [Bug tree-optimization/101173] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-06-23  7:09 ` rguenth at gcc dot gnu.org
2021-06-23  8:03 ` rguenth at gcc dot gnu.org
2021-06-24  1:53 ` amker at gcc dot gnu.org
2021-06-24  7:08 ` rguenth at gcc dot gnu.org
2021-06-28  6:33 ` cvs-commit at gcc dot gnu.org
2021-06-28  6:34 ` [Bug tree-optimization/101173] [9/10/11 " rguenth at gcc dot gnu.org
2021-07-01 10:53 ` rguenth at gcc dot gnu.org
2021-07-01 11:39 ` cvs-commit at gcc dot gnu.org
2021-07-01 12:19 ` rguenth at gcc dot gnu.org
2021-07-02  6:54 ` cvs-commit at gcc dot gnu.org
2021-07-07 14:07 ` cvs-commit at gcc dot gnu.org
2021-09-06 10:18 ` [Bug tree-optimization/101173] [9/10 " cvs-commit at gcc dot gnu.org
2021-10-13 10:09 ` [Bug tree-optimization/101173] [9 " cvs-commit at gcc dot gnu.org
2021-10-13 10:09 ` 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).