aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 04:55:44 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 04:55:44 +0000
commitc3195875c346108303d315cac0c245d80f980dfb (patch)
treeffc896d40cc31d248813ebded64c1c366a0da83a /lib/Target
parentd069a058917c5968774064354516f628159971c6 (diff)
downloadexternal_llvm-c3195875c346108303d315cac0c245d80f980dfb.zip
external_llvm-c3195875c346108303d315cac0c245d80f980dfb.tar.gz
external_llvm-c3195875c346108303d315cac0c245d80f980dfb.tar.bz2
fix PR4767, a crash because fp stackifier visited blocks in
depth first order, so it wouldn't process unreachable blocks. When compiling at -O0, late dead block elimination isn't done and the bad instructions got to isel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index af0da6f..d9a05a8 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -213,6 +213,14 @@ bool FPS::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I)
Changed |= processBasicBlock(MF, **I);
+ // Process any unreachable blocks in arbitrary order now.
+ if (MF.size() == Processed.size())
+ return Changed;
+
+ for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB)
+ if (Processed.insert(BB))
+ Changed |= processBasicBlock(MF, *BB);
+
return Changed;
}