public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111233] New: Wrong code at -O3 on x86_64-linux-gnu since r14-2852-gf5fb9ff2396
@ 2023-08-30  7:02 shaohua.li at inf dot ethz.ch
  2023-08-30  7:04 ` [Bug tree-optimization/111233] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: shaohua.li at inf dot ethz.ch @ 2023-08-30  7:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111233
           Summary: Wrong code at -O3 on x86_64-linux-gnu since
                    r14-2852-gf5fb9ff2396
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
                CC: hubicka at gcc dot gnu.org, jh at suse dot cz
  Target Milestone: ---

gcc at -O3 produces the wrong code.

Bisected to r14-2852-gf5fb9ff2396

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

$ cat a.c
int printf(const char *, ...);
int a, c, f;
char b, g;
int *d = &c;
long e;
int main() {
  for (; e != 25; e++) {
    f = -17;
    for (; f <= 0; f = f + 7) {
      g = f ? 0 : b;
      a = *d;
    }
  }
  printf("%d\n", a);g
}
$
$ gcc -O2 a.c && ./a.out
0
$ gcc -O3 a.c
$ ./a.out
(Timeout)
$

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

end of thread, other threads:[~2023-11-14 14:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30  7:02 [Bug c/111233] New: Wrong code at -O3 on x86_64-linux-gnu since r14-2852-gf5fb9ff2396 shaohua.li at inf dot ethz.ch
2023-08-30  7:04 ` [Bug tree-optimization/111233] [14 Regression] " pinskia at gcc dot gnu.org
2023-08-30  7:38 ` xry111 at gcc dot gnu.org
2023-08-30  7:40 ` shaohua.li at inf dot ethz.ch
2023-08-30  8:35 ` rguenth at gcc dot gnu.org
2023-11-14 14:13 ` cvs-commit at gcc dot gnu.org
2023-11-14 14:16 ` 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).