[llvm-branch-commits] [clang] 6bbb04a - [Driver] Default Generic_GCC ppc/ppc64/ppc64le to -fasynchronous-unwind-tables

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 21 15:37:15 PST 2020


Author: Fangrui Song
Date: 2020-12-21T15:32:35-08:00
New Revision: 6bbb04a732cdf203282f93b95d5a89cfc6fed8f4

URL: https://github.com/llvm/llvm-project/commit/6bbb04a732cdf203282f93b95d5a89cfc6fed8f4
DIFF: https://github.com/llvm/llvm-project/commit/6bbb04a732cdf203282f93b95d5a89cfc6fed8f4.diff

LOG: [Driver] Default Generic_GCC ppc/ppc64/ppc64le to -fasynchronous-unwind-tables

GCC made the switch on 2018-04-10 ("rs6000: Enable -fasynchronous-unwind-tables by default").
In Clang, FreeBSD/NetBSD powerpc have already defaulted to -fasynchronous-unwind-tables.

This patch defaults Generic_GCC powerpc (which affects Linux) to use -fasynchronous-unwind-tables.

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D92054

Added: 
    

Modified: 
    clang/docs/ReleaseNotes.rst
    clang/lib/Driver/ToolChains/Gnu.cpp
    clang/test/Driver/ppc-features.cpp

Removed: 
    


################################################################################
diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a3038aa03cde..dd4de2d2015f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -118,6 +118,10 @@ Modified Compiler Flags
   `-fno-delete-null-pointer-checks` has gained the power to remove the
   `nonnull` attribute on `this` for configurations that need it to be nullable.
 - ``-gsplit-dwarf`` no longer implies ``-g2``.
+- ``-fasynchronous-unwind-tables`` is now the default on Linux AArch64/PowerPC.
+  This behavior matches newer GCC.
+  (`D91760 <https://reviews.llvm.org/D91760>`_)
+  (`D92054 <https://reviews.llvm.org/D92054>`_)
 
 Removed Compiler Flags
 -------------------------

diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 08158ba4bae8..9da6d8e35594 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2674,6 +2674,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
 bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
   switch (getArch()) {
   case llvm::Triple::aarch64:
+  case llvm::Triple::ppc:
+  case llvm::Triple::ppc64:
+  case llvm::Triple::ppc64le:
   case llvm::Triple::x86_64:
     return true;
   default:

diff  --git a/clang/test/Driver/ppc-features.cpp b/clang/test/Driver/ppc-features.cpp
index 91ec459ce181..fceda63f5a23 100644
--- a/clang/test/Driver/ppc-features.cpp
+++ b/clang/test/Driver/ppc-features.cpp
@@ -1,6 +1,7 @@
 /// Check default CC1 and linker options for ppc32.
 // RUN: %clang -### -target powerpc-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC32 %s
-// PPC32: "-mfloat-abi" "hard"
+// PPC32:      "-munwind-tables"
+// PPC32-SAME: "-mfloat-abi" "hard"
 
 // PPC32: "-m" "elf32ppclinux"
 
@@ -38,11 +39,12 @@
 
 
 /// Check default CC1 and linker options for ppc64.
-// RUN: %clang -### -target powerpc64le-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC64 %s
-// RUN: %clang -### -target powerpc64-unknown-linux-gnu %s 2>&1 | FileCheck -check-prefix=PPC64BE %s
-// PPC64: "-mfloat-abi" "hard"
+// RUN: %clang -### -target powerpc64le-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefixes=PPC64,PPC64LE %s
+// RUN: %clang -### -target powerpc64-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefixes=PPC64,PPC64BE %s
+// PPC64:      "-munwind-tables"
+// PPC64-SAME: "-mfloat-abi" "hard"
 
-// PPC64: "-m" "elf64lppc"
+// PPC64LE: "-m" "elf64lppc"
 // PPC64BE: "-m" "elf64ppc"
 
 // check -msoft-float option for ppc64


        


More information about the llvm-branch-commits mailing list