[ARM] In dynamic-no-pic mode, ARM's post-RA pseudo expansion was incorrectly
[oota-llvm.git] / lib / Target / ARM / ARMInstrInfo.cpp
index 77002449016535aaf627daa17bf6a69e31f49b98..484a5e452a1250445c80500ba2eff9cfed275080 100644 (file)
@@ -92,10 +92,10 @@ unsigned ARMInstrInfo::getUnindexedOpcode(unsigned Opc) const {
 
 void ARMInstrInfo::expandLoadStackGuard(MachineBasicBlock::iterator MI,
                                         Reloc::Model RM) const {
-  if (RM == Reloc::Static)
-    expandLoadStackGuardBase(MI, ARM::LDRLIT_ga_abs, ARM::LDRi12, RM);
-  else
+  if (RM == Reloc::PIC_)
     expandLoadStackGuardBase(MI, ARM::LDRLIT_ga_pcrel, ARM::LDRi12, RM);
+  else
+    expandLoadStackGuardBase(MI, ARM::LDRLIT_ga_abs, ARM::LDRi12, RM);
 }
 
 namespace {