https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121131
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:5a5e72590c58ffc614170e93aa5aad8e0c55e00a commit r15-9998-g5a5e72590c58ffc614170e93aa5aad8e0c55e00a Author: Jakub Jelinek <ja...@redhat.com> Date: Fri Jul 18 09:20:30 2025 +0200 gimple-fold: Fix up big endian _BitInt adjustment [PR121131] The following testcase ICEs because SCALAR_INT_TYPE_MODE of course doesn't work for large BITINT_TYPE types which have BLKmode. native_encode* as well as e.g. r14-8276 use in cases like these GET_MODE_SIZE (SCALAR_INT_TYPE_MODE ()) and TREE_INT_CST_LOW (TYPE_SIZE_UNIT ()) for the BLKmode ones. In this case, it wants bits rather than bytes, so I've used GET_MODE_BITSIZE like before and TYPE_SIZE otherwise. Furthermore, the patch only computes encoding_size for big endian targets, for little endian we don't really adjust anything, so there is no point computing it. 2025-07-18 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/121131 * gimple-fold.cc (fold_nonarray_ctor_reference): Use TREE_INT_CST_LOW (TYPE_SIZE ()) instead of GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE ()) for BLKmode BITINT_TYPEs. Don't compute encoding_size at all for little endian targets. * gcc.dg/bitint-124.c: New test. (cherry picked from commit 90955b2f61f787ebc446f0a105b5f49672388d89)