Skip to content

PR for llvm/llvm-project#57084 #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2022
Merged

PR for llvm/llvm-project#57084 #120

merged 2 commits into from
Aug 22, 2022

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Aug 19, 2022

asb added 2 commits August 19, 2022 19:52
As reported in <llvm/llvm-project#57084>,
under hard float ABIs there are issues with lowering structs that
inherit from other structs.

See <https://reviews.llvm.org/D131677> for a fix.

(cherry picked from commit d17de54)
… hard-float ABIs

The hard float ABIs have a rule that if a flattened struct contains
either a single fp value, or an int+fp, or fp+fp then it may be passed
in a pair of registers (if sufficient GPRs+FPRs are available).
detectFPCCEligibleStruct and the helper it calls,
detectFPCCEligibleStructHelper examine the type of the argument/return
value to determine if it complies with the requirements for this ABI
rule.

As reported in bug #57084, this logic produces incorrect results for C++
structs that inherit from other structs. This is because only the fields
of the struct were examined, but enumerating RD->fields misses any
fields in inherited C++ structs. This patch corrects that issue by
adding appropriate logic to enumerate any included base structs.

Differential Revision: https://reviews.llvm.org/D131677

(cherry picked from commit bc53832)
@llvmbot
Copy link
Member Author

llvmbot commented Aug 19, 2022

@kito-cheng @jrtc27 What do you think about merging this PR to the release branch?

@jrtc27
Copy link
Contributor

jrtc27 commented Aug 19, 2022

(Curious that the bot is asking me that, hmmmm :))

I think it makes sense to do; the existing code was clearly wrong and this is self-contained to only those cases

@tru tru merged commit 43fb0d7 into release/15.x Aug 22, 2022
@tru tru deleted the llvm-issue57084 branch August 22, 2022 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RISCV] Clang implements lp64d ABI incorrectly for inherited structs
4 participants