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

--- Comment #2 from Bi6c <bic60176 at gmail dot com> ---
OS: Ubuntu 22.04.3 LTS
We found that GCC failed to detect a signed integer overflow error in
gcc-14.1.0 at optimization level 0.

$ ~/compiler-builds/gcc-13.2.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-O0 testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
-2
$ cat exec.err
testcase.c:20:64: runtime error: signed integer overflow: 61952 * 61952 cannot
be represented in type 'int'
$ ~/compiler-builds/gcc-14.1.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-O0 testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
-2
$ cat exec.err
$

Reply via email to