From a55727f334b39600bfc71144b11b42aae6b94e0b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 2 Feb 2022 11:20:55 +0100 Subject: [PATCH] [AVR] Avoid reusing the same variable name (NFC) Apparently GCC 5.4 (a supported compiler) has a bug where it will use the "MachineInstr &MI" defined by the range-based for loop to evaluate the for loop expression. Pick a different variable name to avoid this. (cherry picked from commit f8f55f7e0343634e8cf0892883ce7132b7a0dc50) --- llvm/lib/Target/AVR/AVRFrameLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AVR/AVRFrameLowering.cpp b/llvm/lib/Target/AVR/AVRFrameLowering.cpp index b3bc9ede205eb8..42a6e4f55dc868 100644 --- a/llvm/lib/Target/AVR/AVRFrameLowering.cpp +++ b/llvm/lib/Target/AVR/AVRFrameLowering.cpp @@ -298,11 +298,11 @@ bool AVRFrameLowering::restoreCalleeSavedRegisters( /// Replace pseudo store instructions that pass arguments through the stack with /// real instructions. static void fixStackStores(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, + MachineBasicBlock::iterator StartMI, const TargetInstrInfo &TII, Register FP) { // Iterate through the BB until we hit a call instruction or we reach the end. for (MachineInstr &MI : - llvm::make_early_inc_range(llvm::make_range(MI, MBB.end()))) { + llvm::make_early_inc_range(llvm::make_range(StartMI, MBB.end()))) { if (MI.isCall()) break;