https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108995
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:ace65db9215882b95e2ead1bb0dc8c54c2ea69be commit r13-6550-gace65db9215882b95e2ead1bb0dc8c54c2ea69be Author: Richard Biener <rguent...@suse.de> Date: Wed Mar 8 09:06:44 2023 +0100 middle-end/108995 - avoid folding when sanitizing overflow The following plugs one place in extract_muldiv where it should avoid folding when sanitizing overflow. PR middle-end/108995 * fold-const.cc (extract_muldiv_1): Avoid folding (CST * b) / CST2 when sanitizing overflow and we rely on overflow being undefined. * gcc.dg/ubsan/pr108995.c: New testcase.