]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/symtab-thunks.cc
symtab-thunks: Use aggregate_value_p even on is_gimple_reg_type returns [PR112941]
authorJakub Jelinek <jakub@redhat.com>
Fri, 22 Dec 2023 11:28:54 +0000 (12:28 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 22 Dec 2023 11:28:54 +0000 (12:28 +0100)
commit0a6aa1927597d821a85bc3d1fd7682256c25b548
tree8c794f478b2f30677f895c4eaf5dac98036106d7
parentf5198f0264e773d3b5d55f09a579313b0b231527
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.
gcc/symtab-thunks.cc
gcc/testsuite/gcc.dg/bitint-60.c [new file with mode: 0644]