Blame SOURCES/gcc48-rh1537828-6.patch

802f23
commit 49033c9c57a415db02ac5d98badf5f53342bca83
802f23
Author: krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
802f23
Date:   Thu Apr 12 09:14:57 2018 +0000
802f23
802f23
    IBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm
802f23
    
802f23
    The CFI magic we emit as part of the indirect branch thunks in order to
802f23
    have somewhat sane unwind information must not be emitted with
802f23
    -fno-dwarf2-cfi-asm.
802f23
    
802f23
    gcc/ChangeLog:
802f23
    
802f23
    2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
802f23
    
802f23
            * config/s390/s390.c (s390_output_indirect_thunk_function): Check
802f23
            also for flag_dwarf2_cfi_asm.
802f23
    
802f23
    gcc/testsuite/ChangeLog:
802f23
    
802f23
    2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
802f23
    
802f23
            * gcc.target/s390/nobp-no-dwarf2-cfi.c: New test.
802f23
    
802f23
    
802f23
    
802f23
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259340 138bc75d-0d04-0410-961f-82ee72b054a4
802f23
802f23
diff -Nrup gcc/config/s390/s390.c gcc/config/s390/s390.c
802f23
--- gcc/config/s390/s390.c	2018-04-18 13:35:43.856279249 -0600
802f23
+++ gcc/config/s390/s390.c	2018-04-18 13:36:21.037007877 -0600
802f23
@@ -14091,7 +14091,7 @@ s390_output_indirect_thunk_function (uns
802f23
 
802f23
      calls: Instead of caller->thunk the backtrace will be
802f23
      caller->callee->thunk   */
802f23
-  if (flag_asynchronous_unwind_tables)
802f23
+  if (flag_asynchronous_unwind_tables && flag_dwarf2_cfi_asm)
802f23
     {
802f23
       fputs ("\t.cfi_signal_frame\n", asm_out_file);
802f23
       fprintf (asm_out_file, "\t.cfi_return_column %d\n", regno);
802f23
diff --git gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c
802f23
new file mode 100644
802f23
index 0000000..75e32a1
802f23
--- /dev/null
802f23
+++ gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c
802f23
@@ -0,0 +1,19 @@
802f23
+/* { dg-do run } */
802f23
+/* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table -fno-dwarf2-cfi-asm" } */
802f23
+
802f23
+/* Make sure that we do not emit .cfi directives when -fno-dwarf2-cfi-asm is being used.  */
802f23
+
802f23
+int
802f23
+main ()
802f23
+{
802f23
+  return 0;
802f23
+}
802f23
+
802f23
+/* 1 x main
802f23
+/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */
802f23
+/* { dg-final { scan-assembler "ex\t" } } */
802f23
+
802f23
+/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */
802f23
+/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */
802f23
+/* { dg-final { scan-assembler     "section\t.s390_return_reg" } } */
802f23
+/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */