https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128458
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:4d11a05988d3f57e947b705ed81247654a86004d commit r17-6121-g4d11a05988d3f57e947b705ed81247654a86004d Author: Richard Biener <[email protected]> Date: Tue Nov 10 14:17:35 2026 +0100 tree-optimization/128458 - do not drop pow calls without powi builtin When linearizing a multiplication chain, try_special_add_to_ops records a __builtin_pow call with a constant integer exponent as its base with an occurrence count. attempt_builtin_powi then gives up when there is no __builtin_powi variant for the type of the chain, for example for _Float64 which is a distinct type from double, leaving the entry with the occurrence count in the operand vector. The rest of reassoc treats that entry as a single occurrence of the base, so the pow call is dropped from the product. Instead of giving up, expand the powers as a series of multiplications as already done for integral types. PR tree-optimization/128458 * tree-ssa-reassoc.cc (attempt_builtin_powi): Expand powers as multiplications if BUILT_IN_POWI does not exist for the type instead of giving up. * gcc.dg/pr128458.c: New testcase.
