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

--- Comment #3 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Here is a test without using any flags (fails at -O{s,2,3}), assuming it's due
to the same root cause: 

[595] % 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/16.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 16.0.0 20250611 (experimental) (GCC) 
[596] % 
[596] % gcctk -O3 small.c
[597] % ./a.out
Aborted
[598] % cat small.c
int printf(const char *, ...);
int a, b, c;
unsigned d = 1;
int main() {
  if (a)
    printf("0");
  int e = -1;
  if (a < 1) {
    e = c;
    if (c)
      while (1)
        ;
  }
  b = (~e + 0UL) / -1;
  if (d > b)
    __builtin_abort();
  return 0;
}

Reply via email to