https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127764
--- Comment #3 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:af401d2507d2c50fa551291490a1482660c4d417 commit r17-4984-gaf401d2507d2c50fa551291490a1482660c4d417 Author: Richard Biener <[email protected]> Date: Thu Oct 8 11:26:09 2026 +0200 tree-optimization/127764 - bogus switch stmt IPA predicates set_switch_stmt_execution_predicate does wide_int_to_tree (type, wi::to_wide (min)) to extend min, but that fails to preserve the sign and in general is a bad idiom when the precision between min an type differs. Using ::to_widest is the appropriate thing to do. PR tree-optimization/127764 * ipa-fnsummary.cc (set_switch_stmt_execution_predicate): Use wi::to_widest to preserve sign when extending min to type. * gcc.dg/torture/pr127764.c: New testcase.
