diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2018-04-12 09:14:57 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2018-04-12 09:14:57 +0000 |
commit | b9dd1a79284dd9883c1eec0412145108135e3d75 (patch) | |
tree | 8cc85a16fe626b1297e2c269ba4d36e8fc19286b /gcc | |
parent | c72a0e67a2fe102d9b40463ab01c9080a996a09f (diff) | |
download | gcc-b9dd1a79284dd9883c1eec0412145108135e3d75.zip gcc-b9dd1a79284dd9883c1eec0412145108135e3d75.tar.gz gcc-b9dd1a79284dd9883c1eec0412145108135e3d75.tar.bz2 |
IBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm
The CFI magic we emit as part of the indirect branch thunks in order to
have somewhat sane unwind information must not be emitted with
-fno-dwarf2-cfi-asm.
gcc/ChangeLog:
2018-04-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.c (s390_output_indirect_thunk_function): Check
also for flag_dwarf2_cfi_asm.
gcc/testsuite/ChangeLog:
2018-04-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/nobp-no-dwarf2-cfi.c: New test.
From-SVN: r259340
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c | 19 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 469c6ff..5d10cbf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-04-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + + * config/s390/s390.c (s390_output_indirect_thunk_function): Check + also for flag_dwarf2_cfi_asm. + 2018-04-12 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/85342 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 59f5de9..5add598 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -16522,7 +16522,7 @@ s390_output_indirect_thunk_function (unsigned int regno, bool z10_p) Stopping in the thunk: backtrace will point to the thunk target is if it was interrupted by a signal. For a call this means that the call chain will be: caller->callee->thunk */ - if (flag_asynchronous_unwind_tables) + if (flag_asynchronous_unwind_tables && flag_dwarf2_cfi_asm) { fputs ("\t.cfi_signal_frame\n", asm_out_file); fprintf (asm_out_file, "\t.cfi_return_column %d\n", regno); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 27a0f47..d6cdfd4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-04-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + + * gcc.target/s390/nobp-no-dwarf2-cfi.c: New test. + 2018-04-12 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/85342 diff --git a/gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c b/gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c new file mode 100644 index 0000000..75e32a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table -fno-dwarf2-cfi-asm" } */ + +/* Make sure that we do not emit .cfi directives when -fno-dwarf2-cfi-asm is being used. */ + +int +main () +{ + return 0; +} + +/* 1 x main +/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ +/* { dg-final { scan-assembler "ex\t" } } */ + +/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ +/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ +/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ +/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ |