https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113120
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:efef8d7ff43c6c489fd6e7c52d71494d21324c87 commit r14-7001-gefef8d7ff43c6c489fd6e7c52d71494d21324c87 Author: Jakub Jelinek <ja...@redhat.com> Date: Mon Jan 8 13:58:28 2024 +0100 lower-bitint: Fix up lowering of huge _BitInt 0 PHI args [PR113120] The PHI argument expansion of INTEGER_CSTs where bitint_min_cst_precision returns significantly smaller precision than the PHI result precision is optimized by loading the much smaller constant (if any) from memory and then either setting the remaining limbs to {} or calling memset with -1. The case where no constant is loaded (i.e. c == NULL) is when the INTEGER_CST is 0 or all_ones - in that case we can just set all the limbs to {} or call memset with -1 on everything. While for the all ones extension case that is what the code was already doing, I missed one spot in the zero extension case, where constricting the offset of the MEM_REF lhs of the = {} store it was using unconditionally the byte size of c, which obviously doesn't work if c is NULL. In that case we want to use zero offset. 2024-01-08 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/113120 * gimple-lower-bitint.cc (gimple_lower_bitint): Fix handling of very large _BitInt zero INTEGER_CST PHI argument. * gcc.dg/bitint-62.c: New test.