public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/111408] New: [14 Regression] Wrong code at -O2/3 on x86_64-linux-gnu since r14-2866-ge68a31549d9
@ 2023-09-13 21:06 shaohua.li at inf dot ethz.ch
  2023-09-13 21:30 ` [Bug target/111408] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: shaohua.li at inf dot ethz.ch @ 2023-09-13 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111408
           Summary: [14 Regression] Wrong code at -O2/3 on
                    x86_64-linux-gnu since r14-2866-ge68a31549d9
           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
  Target Milestone: ---

gcc at -O2/s produced the wrong code.

Bisected to r14-2866-ge68a31549d9

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

$ cat a.c
int printf(const char *, ...);
int a, b, c, d;
short e;
int f() {
  c = a % (sizeof(int) * 8);
  if (b & 1 << c)
    return -1;
  return 0;
}
int main() {
  for (; e != 1; e++) {
    int g = f();
    if (g + d - 9 + d)
      continue;
    for (;;)
      __builtin_abort();
  }
}
$
$ gcc -O0 a.c && ./a.out
$
$ gcc -O2 a.c && ./a.out
[2]    1281121 abort      ./a.out
$

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

end of thread, other threads:[~2023-12-17 13:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13 21:06 [Bug tree-optimization/111408] New: [14 Regression] Wrong code at -O2/3 on x86_64-linux-gnu since r14-2866-ge68a31549d9 shaohua.li at inf dot ethz.ch
2023-09-13 21:30 ` [Bug target/111408] " pinskia at gcc dot gnu.org
2023-09-13 21:45 ` pinskia at gcc dot gnu.org
2023-09-13 21:47 ` pinskia at gcc dot gnu.org
2023-10-17 12:55 ` rguenth at gcc dot gnu.org
2023-11-24 14:00 ` jakub at gcc dot gnu.org
2023-11-25  9:32 ` cvs-commit at gcc dot gnu.org
2023-11-25  9:33 ` jakub at gcc dot gnu.org
2023-12-05 16:32 ` cvs-commit at gcc dot gnu.org
2023-12-16  0:37 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit 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).