https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65773
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #11) > So, the source in question is: > const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc)) > .addReg(DestReg, getDefRegState(true)) > .addFrameIndex(FI); > The way to fix llvm' sources is do to: const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc)); MI.addReg(DestReg, getDefRegState(true)).addFrameIndex(FI); Which allows for the return value of buildmi to expand its life time past the end of the statement.