Do not reserve $gp as a dedicated global base register if the target ABI is not O32.

llvm-svn: 151614
This commit is contained in:
Akira Hatanaka 2012-02-28 03:17:38 +00:00
parent 6ca4fd5b88
commit b8a8e0c262
1 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,8 @@ void MipsDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) {
unsigned V0, V1, GlobalBaseReg = MipsFI->getGlobalBaseReg();
bool FixGlobalBaseReg = MipsFI->globalBaseRegFixed();
if (FixGlobalBaseReg) // $gp is the global base register.
if (Subtarget.isABI_O32() && FixGlobalBaseReg)
// $gp is the global base register.
V0 = V1 = GlobalBaseReg;
else {
const TargetRegisterClass *RC;