S/390: Fix PR84295
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 9 Feb 2018 11:42:34 +0000 (11:42 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 9 Feb 2018 11:42:34 +0000 (11:42 +0000)
gcc/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* config/s390/s390.c (s390_set_current_function): Invoke
s390_indirect_branch_settings also if fndecl didn't change.

gcc/testsuite/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* gcc.target/s390/pr84295.c: New test.

From-SVN: r257522

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/pr84295.c [new file with mode: 0644]

index fc3d80c3552239e417eefa12af884a680543a390..7a01d21026e27516a323402d783b7cae6e868f57 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       PR target/PR84295
+       * config/s390/s390.c (s390_set_current_function): Invoke
+       s390_indirect_branch_settings also if fndecl didn't change.
+
 2018-02-09  Alexandre Oliva <aoliva@redhat.com>
 
        * config/rs6000/rs6000.md (blockage): Set length to zero.
index 62a60e2c9539d8582300255b7d8d5e59a3050685..298fdd164904102406ffb52c0ca3757627eada8f 100644 (file)
@@ -16135,7 +16135,10 @@ s390_set_current_function (tree fndecl)
      several times in the course of compiling a function, and we don't want to
      slow things down too much or call target_reinit when it isn't safe.  */
   if (fndecl == s390_previous_fndecl)
-    return;
+    {
+      s390_indirect_branch_settings (fndecl);
+      return;
+    }
 
   tree old_tree;
   if (s390_previous_fndecl == NULL_TREE)
index ff8136e2234105a546197368fbf4ffb3fc86f142..25c8afca21c7fe1b4ac7ae6d53c7bc1f0d4ac06a 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       PR target/PR84295
+       * gcc.target/s390/pr84295.c: New test.
+
 2018-02-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/77522
diff --git a/gcc/testsuite/gcc.target/s390/pr84295.c b/gcc/testsuite/gcc.target/s390/pr84295.c
new file mode 100644 (file)
index 0000000..4da43c3
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z900 -fgnu89-inline --save-temps -mfunction-return-reg=thunk -mindirect-branch-table" } */
+
+extern void foo (void);
+extern __inline  void foo (void) {}
+void foo (void) {}
+
+/* { 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" } } */