aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-04-04 23:48:31 +0000
committerDale Johannesen <dalej@apple.com>2008-04-04 23:48:31 +0000
commita4091d34f3c05717eb5bb66a1257a0c1005e6dfa (patch)
tree8ad0aa3149ac8196e19d714f6ff2be953169cdb2 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent3e3dc57d3ff2aa010a5ac873933a6107221b4c13 (diff)
Make sure both PendingLoads and PendingExports are flushed
before an invoke. Failure to do this causes references in the landing pad to variables that were not set. Fixes g++.dg/eh/delayslot1.C g++.dg/eh/fp-regs.C g++.old-deja/g++.brendan/eh1.C git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index f237cafd49..cfef9acd4f 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -3171,7 +3171,10 @@ void SelectionDAGLowering::LowerCallTo(CallSite CS, SDOperand Callee,
// Insert a label before the invoke call to mark the try range. This can be
// used to detect deletion of the invoke via the MachineModuleInfo.
BeginLabel = MMI->NextLabelID();
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
+ // Both PendingLoads and PendingExports must be flushed here;
+ // this call might not return.
+ (void)getRoot();
+ DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getControlRoot(),
DAG.getConstant(BeginLabel, MVT::i32),
DAG.getConstant(1, MVT::i32)));
}