From 0d9f17de8f21a10702de1510b73e89d07b3b9bbf Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 15 Apr 2015 14:17:44 +0100 Subject: Move the linear order to the HGraph. Bug found by Zheng Xu: SsaLivenessAnalysis being a stack allocated object, we should not refer to it in later phases of the compiler. Specifically, the code generator was using the linear order, which was stored in the liveness analysis object. Change-Id: I574641f522b7b86fc43f3914166108efc72edb3b --- compiler/optimizing/live_ranges_test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/live_ranges_test.cc') diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index 61d6593f2b..52367730ed 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -69,7 +69,7 @@ TEST(LiveRangesTest, CFG1) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); LiveInterval* interval = liveness.GetInstructionFromSsaIndex(0)->GetLiveInterval(); @@ -117,7 +117,7 @@ TEST(LiveRangesTest, CFG2) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); LiveInterval* interval = liveness.GetInstructionFromSsaIndex(0)->GetLiveInterval(); @@ -168,7 +168,7 @@ TEST(LiveRangesTest, CFG3) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); // Test for the 4 constant. @@ -247,7 +247,7 @@ TEST(LiveRangesTest, Loop1) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); // Test for the 0 constant. @@ -327,7 +327,7 @@ TEST(LiveRangesTest, Loop2) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); // Test for the 0 constant. @@ -405,7 +405,7 @@ TEST(LiveRangesTest, CFG4) { std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); // Test for the 0 constant. -- cgit v1.2.3-59-g8ed1b