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

--- Comment #6 from CTC <19373742 at buaa dot edu.cn> ---
(In reply to Andrew Pinski from comment #4)
> Reducing this but it is taking a little longer as I get to the case where we
> get undefined code on accident so I need to test it using
> -fsanitize=undefined,address also.

For the unreduced program and optimizations, I test it with
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations and
-fsanitize=undefined. Both of them got floating point exception too.

I reduced the program with -fsanitize=undefined. The result doesn't get
floating point exception. But its return value is not 0.

# gcc-13 -I /root/csmith/include/csmith-2.3.0/ -O3 -fno-inline-small-functions
-fno-tree-fre -fno-delete-dead-exceptions -fexpensive-optimizations
-fipa-pure-const -fipa-sra -fthread-jumps -ftree-dce -ftree-dominator-opts
-ftree-forwprop -ftree-pre -ftree-tail-merge -fnon-call-exceptions
-fsanitize=undefined -o fails.o testcase.i -Wfatal-errors
# ./fails.o
# echo $?
64

# gcc-13 -I /root/autodl-fs/csmith/include/csmith-2.3.0/ -o works testcase.i
-Wfatal-errors
# ./works
# echo $?
0

# cat testcase.i
int a;
void main() { int b = a;}

Reply via email to