public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110176] New: wrong code at -Os and above on x86_64-linux-gnu
@ 2023-06-08 14:44 zhendong.su at inf dot ethz.ch
  2023-06-08 21:43 ` [Bug tree-optimization/110176] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-06-08 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110176
           Summary: wrong code at -Os and above on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It seems to affect GCC 10.4 and later.

Compiler Explorer: https://godbolt.org/z/aKfvfxa63


[504] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230607 (experimental) (GCC) 
[505] % 
[505] % gcctk -O1 small.c; ./a.out
[506] % 
[506] % gcctk -O2 small.c
[507] % timeout -s 9 5 ./a.out
Killed
[508] % 
[508] % cat small.c
int a, b;
void c() {}
int d() {
  unsigned f[1];
  int i;
  if (a)
    goto h;
  f[0] = -1;
  while (1) {
    c();
    for (; a < 1; a++) {
      if (0) {
      j:
        continue;
      }
      i = f[0];
      if (a)
        break;
      b = i >= (b == 0);
    }
    if (!b) {
      if (0) {
      h:
        goto j;
      }
      return 0;
    }
  }
}
int main() {
  d();
  return 0;
}

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

end of thread, other threads:[~2024-05-17 11:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 14:44 [Bug tree-optimization/110176] New: wrong code at -Os and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2023-06-08 21:43 ` [Bug tree-optimization/110176] " pinskia at gcc dot gnu.org
2023-06-08 21:50 ` pinskia at gcc dot gnu.org
2023-06-08 21:52 ` [Bug tree-optimization/110176] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-06-08 22:10 ` pinskia at gcc dot gnu.org
2023-06-09  7:11 ` rguenth at gcc dot gnu.org
2023-07-07 10:45 ` [Bug tree-optimization/110176] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-01-04 12:31 ` [Bug tree-optimization/110176] [11/12/13/14 Regression] wrong code at -Os and above on x86_64-linux-gnu since r11-2446 jakub at gcc dot gnu.org
2024-01-04 17:17 ` pinskia at gcc dot gnu.org
2024-01-08  9:37 ` rguenth at gcc dot gnu.org
2024-01-31 13:44 ` rguenth at gcc dot gnu.org
2024-01-31 14:47 ` cvs-commit at gcc dot gnu.org
2024-01-31 14:49 ` [Bug tree-optimization/110176] [11/12/13 " rguenth at gcc dot gnu.org
2024-02-06 13:20 ` cvs-commit at gcc dot gnu.org
2024-05-17 11:12 ` [Bug tree-optimization/110176] [11/12 " 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).