tree-optimization/105368 - avoid overflow in powi_cost
authorRichard Biener <rguenther@suse.de>
Mon, 25 Apr 2022 08:55:21 +0000 (10:55 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 25 Apr 2022 09:46:59 +0000 (11:46 +0200)
commitf0e170f72f8bfaa2a64e1d09ebdfd48f917420f1
tree259fc7afcfe8b3f9535c4ea8ef140185cb1aedac
parentab91c10792cd3a1ba1495aa30a34ca17b043bafb
tree-optimization/105368 - avoid overflow in powi_cost

The following avoids undefined signed overflow when computing
the absolute of the exponent in powi_cost.

2022-04-25  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105368
* tree-ssa-math-opts.cc (powi_cost): Use absu_hwi.
gcc/tree-ssa-math-opts.cc