public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/111519] New: [13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu since r13-455-g1fe04c497d
@ 2023-09-21 13:20 shaohua.li at inf dot ethz.ch
  2023-09-21 15:35 ` [Bug tree-optimization/111519] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: shaohua.li at inf dot ethz.ch @ 2023-09-21 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111519
           Summary: [13/14 Regression] Wrong code at -O3 on
                    x86_64-linux-gnu since r13-455-g1fe04c497d
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
                CC: roger at nextmovesoftware dot com
  Target Milestone: ---

gcc at -O3 produced the wrong code.

Bisected to r13-455-g1fe04c497d

Compiler explorer: https://godbolt.org/z/ozEaKa1rY

$ cat a.c
int printf(const char *, ...);
int a, o;
char b, f, i;
long c;
static signed char d;
static char g;
unsigned *h;
signed char *e = &f;
static signed char **j = &e;
static long k[2];
unsigned **l = &h;
short m;
int main(int q, char *r[]) {
  int p = 0;
  if (q == 0)
    p = 1;
  signed char *n = &d;
  *n = 0;
  for (; c;)
    for (; i; i--)
      ;
  g = 0;
  for (; g <= 1; g++) {
    *n = **j;
    k[g] = 0 != &m;
    *e = l && k[0];
  }
  if (p)
    printf(&b);
  for (; o < 4; o++) {
    a = d;
    if (p)
      printf(&b);
  }
  printf("%d\n", a);
}
$
$ gcc -O2 a.c && ./a.out
1
$ gcc -O3 a.c && ./a.out
0
$

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

end of thread, other threads:[~2023-11-02  9:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21 13:20 [Bug tree-optimization/111519] New: [13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu since r13-455-g1fe04c497d shaohua.li at inf dot ethz.ch
2023-09-21 15:35 ` [Bug tree-optimization/111519] " pinskia at gcc dot gnu.org
2023-09-21 15:47 ` pinskia at gcc dot gnu.org
2023-09-21 16:00 ` rguenth at gcc dot gnu.org
2023-10-09 22:05 ` roger at nextmovesoftware dot com
2023-10-10  7:56 ` rguenth at gcc dot gnu.org
2023-10-10  8:21 ` jakub at gcc dot gnu.org
2023-10-10  8:26 ` rguenth at gcc dot gnu.org
2023-10-10  8:31 ` rguenth at gcc dot gnu.org
2023-10-10  8:33 ` rguenth at gcc dot gnu.org
2023-10-10 10:37 ` rguenth at gcc dot gnu.org
2023-10-11  7:09 ` cvs-commit at gcc dot gnu.org
2023-10-11  7:23 ` cvs-commit at gcc dot gnu.org
2023-10-11  7:24 ` jakub at gcc dot gnu.org
2023-11-02  9:05 ` pinskia 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).