https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108256
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8692b15ae7c05e3224f285069e070c009d9f6efe commit r13-4988-g8692b15ae7c05e3224f285069e070c009d9f6efe Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Jan 4 10:52:49 2023 +0100 ubsan: Avoid narrowing of multiply for -fsanitize=signed-integer-overflow [PR108256] We shouldn't narrow multiplications originally done in signed types, because the original multiplication might overflow but the narrowed one will be done in unsigned arithmetics and will never overflow. 2023-01-04 Jakub Jelinek <ja...@redhat.com> PR sanitizer/108256 * convert.cc (do_narrow): Punt for MULT_EXPR if original type doesn't wrap around and -fsanitize=signed-integer-overflow is on. * fold-const.cc (fold_unary_loc) <CASE_CONVERT>: Likewise. * c-c++-common/ubsan/pr108256.c: New test.