From: Akira Hatanaka Date: Tue, 28 Feb 2012 03:17:38 +0000 (+0000) Subject: Do not reserve $gp as a dedicated global base register if the target ABI is not O32. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b75673b6e18da3937e4cbcd944b081bdc28a6cf5;p=oota-llvm.git Do not reserve $gp as a dedicated global base register if the target ABI is not O32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151614 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp index f60a15e9e56..a1e50b791d8 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp @@ -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;