mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
ARM: Use the PICADD opcode calculated.
We were figuring out whether to use tPICADD or PICADD, then just using tPICADD unconditionally anyway. Oops. A testcase from someone familiar enough with ELF to produce one would be appreciated. The existing PIC testcase correctly verifies the .s generated, but that doesn't catch this bug, which only showed up in direct-to-object mode. http://llvm.org/bugs/show_bug.cgi?id=17180 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
28823ec408
commit
1039e106d0
@ -136,8 +136,12 @@ namespace {
|
||||
unsigned GlobalBaseReg = AFI->getGlobalBaseReg();
|
||||
Opc = TM->getSubtarget<ARMSubtarget>().isThumb2() ? ARM::tPICADD
|
||||
: ARM::PICADD;
|
||||
BuildMI(FirstMBB, MBBI, DL, TII.get(ARM::tPICADD), GlobalBaseReg)
|
||||
.addReg(TempReg).addImm(ARMPCLabelIndex);
|
||||
MIB = BuildMI(FirstMBB, MBBI, DL, TII.get(Opc), GlobalBaseReg)
|
||||
.addReg(TempReg)
|
||||
.addImm(ARMPCLabelIndex);
|
||||
if (Opc == ARM::PICADD)
|
||||
AddDefaultPred(MIB);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user