tree-optimization/105431 - another overflow in powi handling
authorRichard Biener <rguenther@suse.de>
Fri, 29 Apr 2022 06:45:48 +0000 (08:45 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 19 May 2022 11:56:48 +0000 (13:56 +0200)
commit1e43783b3f3570f59bbe80fe38ba65049fa77a0a
tree629b9746c3934da5e8f3e8d072d67714b5236322
parent72c2898ccd8d045b9022539f16fcb5ae9760801f
tree-optimization/105431 - another overflow in powi handling

This avoids undefined signed overflow when calling powi_as_mults_1.

2022-04-29  Richard Biener  <rguenther@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)
gcc/tree-ssa-math-opts.cc