public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/111445] New: Wrong code at -Os on x86_64-linux-gnu since r12-1077-g57bf3751511
@ 2023-09-17 13:21 shaohua.li at inf dot ethz.ch
  2023-09-17 16:12 ` [Bug tree-optimization/111445] [12/13/14 Regression] " 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-09-17 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111445
           Summary: Wrong code at -Os on x86_64-linux-gnu since
                    r12-1077-g57bf3751511
           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: aldyh at redhat dot com
  Target Milestone: ---

gcc at -Os produced the wrong code

Bisected to r12-1077-g57bf3751511

Compiler explorer: https://godbolt.org/z/1Ej5jxYPa

$ cat a.c
int printf(const char *, ...);
short a, b;
unsigned char c = 255;
int main() {
  int d;
  unsigned char e;
  d = 0;
  for (; a >= 0; a--) {
    int *f = &d;
    *f = c;
  }
  e = 0;
  for (; (unsigned char)(d - 255) + e <= 1; e++)
    printf("%d\n", b);
}
$
$ gcc -O0 a.c && ./a.out
0
0
$ gcc -Os a.c && ./a.out
$

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

end of thread, other threads:[~2024-06-21  9:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 13:21 [Bug tree-optimization/111445] New: Wrong code at -Os on x86_64-linux-gnu since r12-1077-g57bf3751511 shaohua.li at inf dot ethz.ch
2023-09-17 16:12 ` [Bug tree-optimization/111445] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-09-18  9:14 ` rguenth at gcc dot gnu.org
2023-10-20 12:04 ` rguenth at gcc dot gnu.org
2023-10-20 12:36 ` rguenth at gcc dot gnu.org
2023-10-20 13:08 ` rguenth at gcc dot gnu.org
2023-10-20 13:53 ` cvs-commit at gcc dot gnu.org
2023-10-20 13:54 ` [Bug tree-optimization/111445] [12/13 " rguenth at gcc dot gnu.org
2023-11-10 14:24 ` cvs-commit at gcc dot gnu.org
2023-11-14 14:20 ` [Bug tree-optimization/111445] [12 " rguenth at gcc dot gnu.org
2023-11-27 13:09 ` cvs-commit at gcc dot gnu.org
2023-11-27 13:10 ` rguenth at gcc dot gnu.org
2024-06-21  9:22 ` 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).