Blame SOURCES/gcc48-rh1537828-6.patch

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