https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123530
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:77ff7c2bb2240d64b8b03c87adc3d42957d59ae8 commit r16-6744-g77ff7c2bb2240d64b8b03c87adc3d42957d59ae8 Author: Jeff Law <[email protected]> Date: Tue Jan 13 07:16:05 2026 -0700 [PR tree-optimization/123530] Fix ICE in recently added match.pd pattern The gimple optimization passes can create negative shift counts and pass them into the simplification routines as seen by the code in pr123530. If we then call tree_to_uhwi on those values we get a nice little ICE. This guards the tree_to_uhwi calls on tree_fits_uhwi_p and resolves the ICE. I just protected them all in this recently added pattern. Bootstrapped and regression tested on x86 and riscv. Also tested on the rest of the embedded targets without any regressions. Pushing to the trunk. PR tree-optimization/123530 gcc/ * match.pd (reassociating xor to enable rotations): Verify constants fit into a uhwi before trying to extract them as a uhwi. gcc/testsuite/ * gcc.dg/torture/pr123530.c: New test.
