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

--- Comment #2 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another likely related test that fails at -O1 and above:
* Compiler Explorer: https://godbolt.org/z/xYG5Y1EfP
* works: 14.* and earlier
* fails: 15.1 and trunk
* -fwrapv or -fno-ivopts makes it disappear

[507] % 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 20250608 (experimental) (GCC) 
[508] % 
[508] % gcctk -O1 small.c
[509] % ./a.out
Aborted
[510] % cat small.c
int c, e = -2149633;
int main() {
  e = -999 - e - 2147483647;
  if (e + c + 6205925 <= 0)
    do {
      e = -c + e + 2144058291;
    } while (999 * e + 4 > 0);
  if (e > 0)
    __builtin_abort();
}

Reply via email to