mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fix bug in RegScavenger::scavengeRegister().
Reserved registers are not candidates for scavenging, and they were removed from the candidate list like this: CreateRegClassMask(RC, Candidates); Candidates ^= ReservedRegs; However, when there are reserved registers outside RC, this causes invalid bits to be set in Candidates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75847 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -426,7 +426,7 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
|
|||||||
// Mask off the registers which are not in the TargetRegisterClass.
|
// Mask off the registers which are not in the TargetRegisterClass.
|
||||||
BitVector Candidates(NumPhysRegs, false);
|
BitVector Candidates(NumPhysRegs, false);
|
||||||
CreateRegClassMask(RC, Candidates);
|
CreateRegClassMask(RC, Candidates);
|
||||||
Candidates ^= ReservedRegs; // Do not include reserved registers.
|
Candidates ^= ReservedRegs & Candidates; // Do not include reserved registers.
|
||||||
|
|
||||||
// Exclude all the registers being used by the instruction.
|
// Exclude all the registers being used by the instruction.
|
||||||
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
|
||||||
|
Reference in New Issue
Block a user