https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105431
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:1e43783b3f3570f59bbe80fe38ba65049fa77a0a commit r12-8396-g1e43783b3f3570f59bbe80fe38ba65049fa77a0a Author: Richard Biener <rguent...@suse.de> Date: Fri Apr 29 08:45:48 2022 +0200 tree-optimization/105431 - another overflow in powi handling This avoids undefined signed overflow when calling powi_as_mults_1. 2022-04-29 Richard Biener <rguent...@suse.de> PR tree-optimization/105431 * tree-ssa-math-opts.cc (powi_as_mults_1): Make n unsigned. (powi_as_mults): Use absu_hwi. (gimple_expand_builtin_powi): Remove now pointless n != -n check. (cherry picked from commit 44b09adb9bad99dd7e3017c5ecefed7f7c9a1590)