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 <jakub@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.