From d9bd6dd333e079bec80ea8ea80515c044fab758c Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Thu, 8 Dec 2016 08:34:13 +0000 Subject: [PATCH] [AVR] Add an assertion to ensure we don't emit LPM when it's unsupported git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289030 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AVR/AVRISelDAGToDAG.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Target/AVR/AVRISelDAGToDAG.cpp b/lib/Target/AVR/AVRISelDAGToDAG.cpp index d190a607513..098ee61b738 100644 --- a/lib/Target/AVR/AVRISelDAGToDAG.cpp +++ b/lib/Target/AVR/AVRISelDAGToDAG.cpp @@ -366,6 +366,8 @@ template <> bool AVRDAGToDAGISel::select(SDNode *N) { return selectIndexedLoad(N); } + assert(Subtarget->hasLPM() && "cannot load from program memory on this mcu"); + // This is a flash memory load, move the pointer into R31R30 and emit // the lpm instruction. MVT VT = LD->getMemoryVT().getSimpleVT(); -- 2.50.1