-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Mips] Fix clang crashes when compiling a variadic function while targeting mips3 #130558
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
Conversation
38ea768
to
1a7f4e4
Compare
1a7f4e4
to
0960960
Compare
@wzssyqa Could you help review this patch, the author of the issue ticket has verified this issue for us, and the verification result is OK, thanks. |
@@ -0,0 +1,53 @@ | |||
; RUN: llc -mtriple=mipsel-linux-gnu -mcpu=mips3 -target-abi o32 < %s | FileCheck %s -check-prefixes=MIPS3-O32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps call this vararg.ll
. Quite a few targets have a test named this.
Re-generate with update_llc_test_checks.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, applied.
ArrayRef<MCPhysReg> MipsABIInfo::GetVarArgRegs() const { | ||
if (IsO32()) | ||
return ArrayRef(O32IntRegs); | ||
ArrayRef<MCPhysReg> MipsABIInfo::GetVarArgRegs(bool isGP64bit) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to getVarArgRegs
(functionName convention) while you are modifying it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, applied.
The title was truncated due to github. It's more readable to ignore github and fix the title.
It seems to apply to newer processors as well. |
0960960
to
995248d
Compare
Thanks! |
Now, I only see mips3 use this feature.
|
@MaskRay Could you help review again, thanks! |
…geting mips3 issue reason: Because mips3 has the feature 'FeatureGP64Bit', when target mips3 process function `writeVarArgRegs`, the result of `getGPRSizeInBytes` is 8 and the result of `GetVarArgRegs` is `Mips::A0, Mips::A1, Mips::A2, Mips::A3`. This would generate `gpr64 = COPY $a1` which should be `gpr64 = COPY $a1_64`. Also when process `CC_Mips_FixedArg`, mips would CCDelegateTo `CC_MipsO32_FP`. In fact, it should CCDelegateTo `CC_MipsN`. Fix llvm#98716.
995248d
to
01c732e
Compare
|
OK, thanks! |
It says to ignore it. |
OK, thanks! |
…geting mips3 (llvm#130558) issue reason: Because mips3 has the feature 'FeatureGP64Bit', when target mips3 process function `writeVarArgRegs`, the result of `getGPRSizeInBytes` is 8 and the result of `GetVarArgRegs` is `Mips::A0, Mips::A1, Mips::A2, Mips::A3`. This would generate `gpr64 = COPY $a1` which should be `gpr64 = COPY $a1_64`. Also when process `CC_Mips_FixedArg`, mips would CCDelegateTo `CC_MipsO32_FP`. In fact, it should CCDelegateTo `CC_MipsN`. Fix llvm#98716.
issue reason:
Because mips3 has the feature 'FeatureGP64Bit', when target mips3 process function
writeVarArgRegs
, the result ofgetGPRSizeInBytes
is 8 and the result ofGetVarArgRegs
isMips::A0, Mips::A1, Mips::A2, Mips::A3
. This would generategpr64 = COPY $a1
which should begpr64 = COPY $a1_64
.Fix #98716.