Blame SOURCES/gcc48-rh1537828-6.patch

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