Skip to content

Commit 2a82e23

Browse files
authored
Fix handling of dontcall attributes for arches that lower calls via fastSelectInstruction (#153302)
Recently my change to avoid duplicate `dontcall` attribute errors (#152810) caused the Clang `Frontend/backend-attribute-error-warning.c` test to fail on Arm32: <https://lab.llvm.org/buildbot/#/builders/154/builds/20134> The root cause is that, if the default `IFastSel` path bails, then targets are given the opportunity to lower instructions via `fastSelectInstruction`. That's the path taken by Arm32 and since its implementation of `selectCall` didn't call `diagnoseDontCall` no error was emitted. I've checked the other implementations of `fastSelectInstruction` and the only other one that lowers call instructions in WebAssembly, so I've fixed that too.
1 parent 6e59d1d commit 2a82e23

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

llvm/lib/Target/ARM/ARMFastISel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,7 @@ bool ARMFastISel::SelectCall(const Instruction *I,
25042504
// Set all unused physreg defs as dead.
25052505
static_cast<MachineInstr *>(MIB)->setPhysRegsDeadExcept(UsedRegs, TRI);
25062506

2507+
diagnoseDontCall(*CI);
25072508
return true;
25082509
}
25092510

llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,8 @@ bool WebAssemblyFastISel::selectCall(const Instruction *I) {
912912

913913
if (!IsVoid)
914914
updateValueMap(Call, ResultReg);
915+
916+
diagnoseDontCall(*Call);
915917
return true;
916918
}
917919

0 commit comments

Comments
 (0)