Commit 050f5a34 authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r303456:

------------------------------------------------------------------------
r303456 | eugenis | 2017-05-19 16:58:48 -0400 (Fri, 19 May 2017) | 3 lines

[safestack] Disable stack coloring by default.

Workaround for apparent miscompilation of PR32143.
------------------------------------------------------------------------

llvm-svn: 303687
parent fba30747
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
; 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 {
+2 −2
Original line number Diff line number Diff line
; 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:
+2 −2
Original line number Diff line number Diff line
; 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 {
+1 −1
Original line number Diff line number Diff line
; 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