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

--- Comment #1 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
The following might be the same or related although it needs several flags to
trigger. 

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

[567] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240626 (experimental) (GCC) 
[568] % 
[568] % gcctk -O2 small.c; ./a.out
[569] % 
[569] % gcctk -O2 -fno-tree-pre -fschedule-insns -fno-forward-propagate
-fno-guess-branch-probability -fno-gcse small.c
[570] % ./a.out
0
[571] % 
[571] % cat small.c
int printf(const char *, ...);
struct {
  unsigned : 8;
  volatile unsigned b : 1;
  int c : 31;
  int d : 5;
} g, k, m, n, p;
unsigned e = 5;
volatile int f = 1;
int h, i, l, o, r, q;
long j, a;
int main() {
  if (0)
  L:
    for (; e; e++)
      ;
  for (; j < 5; j = 0)
    if (f) {
      int t = 7 - (((k.d | 7) ^ m.c) - a) - ~(n.b & -o), u, v = -t ^ q,
          w = e - h;
      u = k.d;
      if (i) {
        if (w > 6)
          goto L;
        printf("%d", l);
      }
      g.d = (g.d & (n.b - 5)) - (-((k.d - 7 - o) & t) ^ (v & q));
      n.b = t;
      m.c = ~(t - (7L & m.c));
      k.d = ~(a & (m.c | ~o) & ~u) & g.d;
      if ((unsigned) p.d >= e)
        printf("0\n");
      return 0;
    }
  return 0;
}

Reply via email to