Hello Zoltan Martonka, Ashwani Raina, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23064
to look at the new patch set (#3).
Change subject: [tablet] avoid -Wpsabi warning in ComputeLowerAndUpperBound on
Rocky ARM
......................................................................
[tablet] avoid -Wpsabi warning in ComputeLowerAndUpperBound on Rocky ARM
GCC 11.5.0 on Rocky Linux ARM emits a -Wpsabi warning when returning
std::pair<double, double> from a function in C++17 mode:
kudu/src/kudu/tablet/compaction_policy.cc:304:63: note: parameter passing for
argument
of type ‘std::pair<double, double>’ when C++17 is enabled changed to match
C++14 in GCC 10.1
304 | std::pair<double, double> ComputeLowerAndUpperBound() const {
| ^
This stems from ABI changes introduced in GCC 10.0, where types like
std::pair<double, double> were treated as homogeneous floating-point aggregates
(HFAs) under AArch64. In GCC 10.1, the behavior was reverted to match C++14,
and a diagnostic warning was added to alert users of potential ABI mismatches
between compiler versions.
In Kudu, the affected function ComputeLowerAndUpperBound() is internal and
not externally visible, so the risk of real ABI breakage is low.
However, to silence the warning and avoid any future ambiguity, this patch
replaces the std::pair return type with a custom BoundRange struct.
Older compilers already treated such a struct as an HFA, so this change makes
the ABI consistent across versions. With newer compilers, the generated code
is unchanged. With older compilers, the function may pass the return value
through a different register, but the effect is purely internal and does not
affect correctness.
Build environment:
- GCC version: 11.5.0 20240719 (Red Hat 11.5.0-5)
- ld (GNU gold) version: 1.16
No functional behavior is changed.
References:
- https://gcc.gnu.org/gcc-10/changes.html
Change-Id: Iab4db585a8eaf152f1fa2884e72e38a4e7c5efa1
---
M src/kudu/tablet/compaction_policy.cc
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/64/23064/3
--
To view, visit http://gerrit.cloudera.org:8080/23064
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iab4db585a8eaf152f1fa2884e72e38a4e7c5efa1
Gerrit-Change-Number: 23064
Gerrit-PatchSet: 3
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Ashwani Raina <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <[email protected]>