public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94125] New: wrong code at -O3 on x86_64-linux-gnu
@ 2020-03-10 16:54 qrzhang at gatech dot edu
  2020-03-10 17:00 ` [Bug tree-optimization/94125] [9/10 Regression] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: qrzhang at gatech dot edu @ 2020-03-10 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94125
           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 appears to be a regression in 9. Gcc-8.3 works fine.

Bisection points to g:8f70fdc31a7b0099e7322d0aba94830fb08f4c88

$ gcc-trunk -v
gcc version 10.0.1 20200310 (experimental) [master revision
cc5c935937d:88ecfc48953:3654d49d0ff651b2a78401bc2430428711e7d2eb] (GCC)


$ gcc-trunk abc.c ; ./a.out
0
0
0
0
0
0
0
0


$ gcc-trunk -O3 abc.c ; ./a.out
0
0
0
4
0
0
0
0


$ gcc-8 -O3 abc.c ; ./a.out
0
0
0
0
0
0
0
0


$ cat abc.c
int printf(const char *, ...);
int *a;
char b, f;
static char c;
short d[1][8][1];
int **e = &a;
short *g = &d[0][3][0];
unsigned char **h;
int i;
int main() {
  unsigned char *j = &b;
  int k[] = {0, 0, 0, 4, 0, 0};
  if (e) {
    unsigned char **l = &j;
    c = 2;
    for (; c >= 0; c--) {
      **l = f;
      *g = k[c + 3];
      k[c + 1] = 0;
    }
  } else {
    unsigned char **m = &j;
    for (;;)
      h = m;
  }
  for (; i < 8; i++)
    printf("%d\n", d[0][i][0]);
}

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

end of thread, other threads:[~2020-03-24 10:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 16:54 [Bug tree-optimization/94125] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2020-03-10 17:00 ` [Bug tree-optimization/94125] [9/10 Regression] " pinskia at gcc dot gnu.org
2020-03-10 17:25 ` jakub at gcc dot gnu.org
2020-03-10 17:34 ` jakub at gcc dot gnu.org
2020-03-10 17:34 ` jakub at gcc dot gnu.org
2020-03-10 18:09 ` law at redhat dot com
2020-03-11  7:39 ` rguenth at gcc dot gnu.org
2020-03-11  9:46 ` rguenth at gcc dot gnu.org
2020-03-11  9:58 ` amker at gcc dot gnu.org
2020-03-12 11:59 ` jakub at gcc dot gnu.org
2020-03-15  6:23 ` amker at gcc dot gnu.org
2020-03-16  3:15 ` cvs-commit at gcc dot gnu.org
2020-03-16  7:38 ` rguenther at suse dot de
2020-03-16  7:44 ` [Bug tree-optimization/94125] [9 " rguenth at gcc dot gnu.org
2020-03-18  9:52 ` amker at gcc dot gnu.org
2020-03-18 10:41 ` rguenther at suse dot de
2020-03-24  9:45 ` cvs-commit at gcc dot gnu.org
2020-03-24 10:00 ` 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).