https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112941
--- Comment #12 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:0a6aa1927597d821a85bc3d1fd7682256c25b548 commit r14-6805-g0a6aa1927597d821a85bc3d1fd7682256c25b548 Author: Jakub Jelinek <ja...@redhat.com> Date: Fri Dec 22 12:28:54 2023 +0100 symtab-thunks: Use aggregate_value_p even on is_gimple_reg_type returns [PR112941] Large/huge _BitInt types are returned in memory and the bitint lowering pass right now relies on that. The gimplification etc. use aggregate_value_p to see if it should be returned in memory or not and use <retval> = _123; return <retval>; rather than return _123; But expand_thunk used e.g. by IPA-ICF was performing an optimization, assuming is_gimple_reg_type is always passed in registers and not calling aggregate_value_p in that case. The following patch changes it to match what the gimplification etc. are doing. 2023-12-22 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/112941 * symtab-thunks.cc (expand_thunk): Check aggregate_value_p regardless of whether is_gimple_reg_type (restype) or not. * gcc.dg/bitint-60.c: New test.