OSDN Git Service

[safestack] Disable stack coloring by default.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 19 May 2017 20:58:48 +0000 (20:58 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 19 May 2017 20:58:48 +0000 (20:58 +0000)
Workaround for apparent miscompilation of PR32143.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303456 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SafeStackColoring.cpp
test/Transforms/SafeStack/X86/coloring-ssp.ll
test/Transforms/SafeStack/X86/coloring.ll
test/Transforms/SafeStack/X86/coloring2.ll
test/Transforms/SafeStack/X86/layout-frag.ll

index 09289f9..21f2fa4 100644 (file)
@@ -20,9 +20,10 @@ using namespace llvm::safestack;
 
 #define DEBUG_TYPE "safestackcoloring"
 
+// Disabled by default due to PR32143.
 static cl::opt<bool> ClColoring("safe-stack-coloring",
                                 cl::desc("enable safe stack coloring"),
-                                cl::Hidden, cl::init(true));
+                                cl::Hidden, cl::init(false));
 
 const StackColoring::LiveRange &StackColoring::getLiveRange(AllocaInst *AI) {
   const auto IT = AllocaNumbering.find(AI);
index 3b04fdf..040632e 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
 
 ; %x and %y share a stack slot between them, but not with the stack guard.
 define void @f() safestack sspreq {
index 76bdf37..60e960e 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
-; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
 
 define void @f() safestack {
 entry:
index 2a8f871..ef00d9b 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
-; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
 
 ; x and y share the stack slot.
 define void @f() safestack {
index b127def..b9831c2 100644 (file)
@@ -1,5 +1,5 @@
 ; Test that safestack layout reuses a region w/o fragmentation.
-; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
+; RUN: opt -safe-stack -safe-stack-coloring=1 -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
 
 define void @f() safestack {
 ; CHECK-LABEL: define void @f