[Bug c/91373] gcc6.2.0: ((U32)((U16 * U16)) >> 31) cannot always get correct result with gcc -O2
qiang.fu at verisilicon dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 6 10:53:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91373
--- Comment #7 from Qiang <qiang.fu at verisilicon dot com> ---
Sorry to be a bother and thanks all of you.
'-fsanitize=undefined' & '-fwrapv' are new item to me.
'-fsanitize=undefined' is helpful to me to find out the similar issue in our
code.
'-fwrapv' may hide other potential issue.
I'll do more check later follow the following instructions before reporting a
bug:
'Before reporting that GCC compiles your code incorrectly, compile it with
gcc -Wall -Wextra and see whether this shows anything wrong with your code.
Similarly, if compiling with -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations makes a difference, or if compiling with
-fsanitize=undefined produces any run-time errors, then your code is probably
not correct.'
More information about the Gcc-bugs
mailing list