public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/111764] New: Wrong code at -O3 on x86_64-linux-gnu since r11-5965-g04bff1bbfc1
@ 2023-10-10 20:54 shaohua.li at inf dot ethz.ch
  2023-10-10 20:57 ` [Bug tree-optimization/111764] [11/12/13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: shaohua.li at inf dot ethz.ch @ 2023-10-10 20:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111764
           Summary: Wrong code at -O3 on x86_64-linux-gnu since
                    r11-5965-g04bff1bbfc1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---

gcc at -O3 produced the wrong code.

Bisected to r11-5965-g04bff1bbfc1

Compiler explorer: https://godbolt.org/z/7vaqadYfP

$ cat a.c
int printf(const char *, ...);
char a;
short b, c;
static short *d = &b, *e = &b;
short(f)(short g, short h) { return g * h; }
int main() {
  *e = 2;
  a = 1;
  for (; a <= 9; a++) {
    short *i = &c;
    *i = *d = f(*e, *e);
  }
  printf("%d\n", c);
}
$
$ gcc -O0 a.c && ./a.out
0
$ gcc -O3 a.c && ./a.out
4
%

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

end of thread, other threads:[~2023-12-15 12:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10 20:54 [Bug tree-optimization/111764] New: Wrong code at -O3 on x86_64-linux-gnu since r11-5965-g04bff1bbfc1 shaohua.li at inf dot ethz.ch
2023-10-10 20:57 ` [Bug tree-optimization/111764] [11/12/13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu pinskia at gcc dot gnu.org
2023-10-10 21:00 ` pinskia at gcc dot gnu.org
2023-10-11 13:36 ` rguenth at gcc dot gnu.org
2023-10-11 13:47 ` rguenth at gcc dot gnu.org
2023-10-12  6:49 ` rguenth at gcc dot gnu.org
2023-10-12  7:12 ` rguenth at gcc dot gnu.org
2023-10-12  8:22 ` cvs-commit at gcc dot gnu.org
2023-10-12  8:22 ` [Bug tree-optimization/111764] [11/12/13 " rguenth at gcc dot gnu.org
2023-11-10 14:24 ` cvs-commit at gcc dot gnu.org
2023-11-27 13:09 ` [Bug tree-optimization/111764] [11/12 " cvs-commit at gcc dot gnu.org
2023-12-15 12:18 ` [Bug tree-optimization/111764] [11 " cvs-commit at gcc dot gnu.org
2023-12-15 12:22 ` 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).