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

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

            Bug ID: 111000
           Summary: Wrong code at -O3 on x86_64-linux-gnu since
                    r14-2944-g3d48c11ad08
           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
  Target Milestone: ---

gcc at -O3 produces the wrong code.

Bisected to r14-2944-g3d48c11ad08

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

$ cat a.c
int printf(const char *, ...);
long a = 68;
int b, d, e;
int main() {
  for (; d <= 6; d++) {
    b = 0;
    for (; b <= 6; b++) {
      int c = a;
      e = c >= 32 || d > 647 >> c ? d : 0;
    }
  }
  printf("%d\n", e);
}
$
$ gcc -O0 a.c &&./a.out
6
$ gcc -O3 a.c && ./a.out
4
$

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-12  7:02 [Bug c/111000] New: Wrong code at -O3 on x86_64-linux-gnu since r14-2944-g3d48c11ad08 shaohua.li at inf dot ethz.ch
2023-08-12  7:07 ` [Bug tree-optimization/111000] [14 Regression] " pinskia at gcc dot gnu.org
2023-08-13 18:20 ` pinskia at gcc dot gnu.org
2023-08-14  8:34 ` rguenth at gcc dot gnu.org
2023-10-17 12:24 ` rguenth at gcc dot gnu.org
2023-10-20 11:20 ` cvs-commit at gcc dot gnu.org
2023-10-20 11:20 ` rguenth at gcc dot gnu.org
2023-11-06 13:18 ` rguenth at gcc dot gnu.org
2023-11-13 12:40 ` 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).