From: Nemanja Ivanovic Date: Fri, 3 Mar 2017 09:49:17 +0000 (+0000) Subject: [PowerPC] Enable -fomit-frame-pointer by default for PPC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee085ed499c5270dc4e09c9ffe5a40477a45e669;p=clang [PowerPC] Enable -fomit-frame-pointer by default for PPC As is the case on platforms like Mips, X86 and SystemZ, the -fomit-frame-pointer should be enabled by default on PPC when optimizing at -O1 and above. This brings the behaviour of LLVM on PPC in line with GCC. Committing on behalf of Hiroshi Inoue. Differential Revision: https://reviews.llvm.org/D29750 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296861 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 042326f68a..283d7ee062 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2235,6 +2235,9 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args, case llvm::Triple::mips64el: case llvm::Triple::mips: case llvm::Triple::mipsel: + case llvm::Triple::ppc: + case llvm::Triple::ppc64: + case llvm::Triple::ppc64le: case llvm::Triple::systemz: case llvm::Triple::x86: case llvm::Triple::x86_64: diff --git a/test/Driver/frame-pointer.c b/test/Driver/frame-pointer.c index cec168636c..ecb16af3cf 100644 --- a/test/Driver/frame-pointer.c +++ b/test/Driver/frame-pointer.c @@ -17,6 +17,13 @@ // RUN: %clang -target s390x-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s // RUN: %clang -target s390x-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s +// RUN: %clang -target powerpc-unknown-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s +// RUN: %clang -target powerpc-unknown-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s +// RUN: %clang -target powerpc64-unknown-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s +// RUN: %clang -target powerpc64-unknown-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s +// RUN: %clang -target powerpc64le-unknown-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s +// RUN: %clang -target powerpc64le-unknown-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s + // RUN: %clang -target mips-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s // RUN: %clang -target mips-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s // RUN: %clang -target mipsel-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s