https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128950
Bug ID: 128950
Summary: gcc.dg/ipa/inline-aggregate-retval.c and
g++.dg/ipa/inline-aggregate-retval.C fail on
hppa64-hp-hpux11.11
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
Assignee: unassigned at gcc dot gnu.org
Reporter: danglin at gcc dot gnu.org
CC: ktkachov at gcc dot gnu.org
Target Milestone: ---
Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
Build: hppa64-hp-hpux11.11
Description
Both gcc.dg/ipa/inline-aggregate-retval.c and
g++.dg/ipa/inline-aggregate-retval.C (added in r17-6370-gbf8c0f3aee9) pass
--param early-inlining-insns=14, which sits right on the threshold for targets
with slightly lower call size estimates for aggregate returns.
On hppa64-hp-hpux11.11, ipa-fnsummary properly marks <retval> = t; as Will be
eliminated by inlining (size: 16), leaving an inlined body size of 26 (9 + 16 +
0.5) for mul (&ga, &gb) (where ga is global, so op0 is not an SRA candidate).
However, the call statement itself has size: 11 on hppa64 (vs 12 on
x86_64/aarch64), giving growth = 26 - 11 = 15 > 14, so einline skips inlining.
Without the ipa-fnsummary.cc optimization, <retval> = t; adds 16 (growth = 31),
so bumping --param early-inlining-insns=14 to --param early-inlining-insns=16
still strictly verifies that <retval> = t; is credited while allowing the tests
to pass on hppa64.
Suggested Patch
To fix the test failures on hppa64, bump --param early-inlining-insns from 14
to 16 in both gcc/testsuite/gcc.dg/ipa/inline-aggregate-retval.c and
gcc/testsuite/g++.dg/ipa/inline-aggregate-retval.C.