https://gcc.gnu.org/g:46c2de7a8560d1fcaaeaf986d90b23d70cf48dd7
commit r14-11841-g46c2de7a8560d1fcaaeaf986d90b23d70cf48dd7 Author: Jakub Jelinek <[email protected]> Date: Tue May 20 08:21:14 2025 +0200 tree-chrec: Use signed_type_for in convert_affine_scev On s390x-linux I've run into the gcc.dg/torture/bitint-27.c test ICEing in build_nonstandard_integer_type called from convert_affine_scev (not sure why it doesn't trigger on x86_64/aarch64). The problem is clear, when ct is a BITINT_TYPE with some large TYPE_PRECISION, build_nonstandard_integer_type won't really work on it. The patch fixes it similarly what has been done for GCC 14 in various other spots. 2025-05-20 Jakub Jelinek <[email protected]> * tree-chrec.cc (convert_affine_scev): Use signed_type_for instead of build_nonstandard_integer_type. (cherry picked from commit e38027c8ff449ffadaca449004bb891b9094ad00) Diff: --- gcc/tree-chrec.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-chrec.cc b/gcc/tree-chrec.cc index 9b272074a2ed..d4b308e17170 100644 --- a/gcc/tree-chrec.cc +++ b/gcc/tree-chrec.cc @@ -1490,7 +1490,7 @@ convert_affine_scev (class loop *loop, tree type, new_step = *step; if (TYPE_PRECISION (step_type) > TYPE_PRECISION (ct) && TYPE_UNSIGNED (ct)) { - tree signed_ct = build_nonstandard_integer_type (TYPE_PRECISION (ct), 0); + tree signed_ct = signed_type_for (ct); new_step = chrec_convert (signed_ct, new_step, at_stmt, use_overflow_semantics); }
