Blame SOURCES/0001-AArch64-Fix-invalid-use-of-references-to-BuildMI.patch

003ced
From 5717e28019e7348a04f63dcf965121171da15c62 Mon Sep 17 00:00:00 2001
003ced
From: James Molloy <james.molloy@arm.com>
003ced
Date: Thu, 16 Apr 2015 11:37:40 +0000
003ced
Subject: [PATCH] [AArch64] Fix invalid use of references to BuildMI.
003ced
003ced
This was found in GCC PR65773 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65773).
003ced
003ced
We shouldn't be taking a reference to the temporary that BuildMI returns, we must copy it.
003ced
003ced
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235088 91177308-0d34-0410-b5e6-96231b3b80d8
003ced
---
003ced
 lib/Target/AArch64/AArch64InstrInfo.cpp | 6 +++---
003ced
 1 file changed, 3 insertions(+), 3 deletions(-)
003ced
003ced
diff --git a/lib/Target/AArch64/AArch64InstrInfo.cpp b/lib/Target/AArch64/AArch64InstrInfo.cpp
003ced
index 8e0af2d..db231c4 100644
003ced
--- a/lib/Target/AArch64/AArch64InstrInfo.cpp
003ced
+++ b/lib/Target/AArch64/AArch64InstrInfo.cpp
003ced
@@ -1526,7 +1526,7 @@ void AArch64InstrInfo::copyPhysRegTuple(
003ced
   }
003ced
 
003ced
   for (; SubReg != End; SubReg += Incr) {
003ced
-    const MachineInstrBuilder &MIB = BuildMI(MBB, I, DL, get(Opcode));
003ced
+    const MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(Opcode));
003ced
     AddSubReg(MIB, DestReg, Indices[SubReg], RegState::Define, TRI);
003ced
     AddSubReg(MIB, SrcReg, Indices[SubReg], 0, TRI);
003ced
     AddSubReg(MIB, SrcReg, Indices[SubReg], getKillRegState(KillSrc), TRI);
003ced
@@ -1904,7 +1904,7 @@ void AArch64InstrInfo::storeRegToStackSlot(
003ced
   }
003ced
   assert(Opc && "Unknown register class");
003ced
 
003ced
-  const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc))
003ced
+  const MachineInstrBuilder MI = BuildMI(MBB, MBBI, DL, get(Opc))
003ced
                                       .addReg(SrcReg, getKillRegState(isKill))
003ced
                                       .addFrameIndex(FI);
003ced
 
003ced
@@ -2002,7 +2002,7 @@ void AArch64InstrInfo::loadRegFromStackSlot(
003ced
   }
003ced
   assert(Opc && "Unknown register class");
003ced
 
003ced
-  const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc))
003ced
+  const MachineInstrBuilder MI = BuildMI(MBB, MBBI, DL, get(Opc))
003ced
                                       .addReg(DestReg, getDefRegState(true))
003ced
                                       .addFrameIndex(FI);
003ced
   if (Offset)
003ced
-- 
003ced
2.4.3
003ced