[llvm-commits] [llvm] r49243 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Dale Johannesen dalej at apple.com
Fri Apr 4 16:48:31 PDT 2008


Author: johannes
Date: Fri Apr  4 18:48:31 2008
New Revision: 49243

URL: http://llvm.org/viewvc/llvm-project?rev=49243&view=rev
Log:
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


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=49243&r1=49242&r2=49243&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr  4 18:48:31 2008
@@ -3171,7 +3171,10 @@
     // 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)));
   }





More information about the llvm-commits mailing list