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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka
2012-04-25 01:24:52 +00:00
parent 23d59c2fb8
commit 25052f4077
3 changed files with 8 additions and 7 deletions

View File

@ -37,8 +37,8 @@ unsigned MipsFunctionInfo::getGlobalBaseReg() {
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
if (FixGlobalBaseReg) // $gp is the global base register.
return GlobalBaseReg = ST.isABI_N64() ? Mips::GP_64 : Mips::GP;
if (FixGlobalBaseReg && ST.isABI_O32()) // $gp is the global base register.
return GlobalBaseReg = Mips::GP;
const TargetRegisterClass *RC = ST.isABI_N64() ?
(const TargetRegisterClass*)&Mips::CPU64RegsRegClass :