Check always_inline flag in s390_can_inline_p [PR104327]
authorAndreas Krebbel <krebbel@linux.ibm.com>
Sun, 6 Feb 2022 08:07:41 +0000 (09:07 +0100)
committerAndreas Krebbel <krebbel@linux.ibm.com>
Mon, 7 Feb 2022 10:18:08 +0000 (11:18 +0100)
commitdb95441cf5399aabc46ca83df19f7290c3e23cb1
tree7ec67943839220c0e91d7c2f8b8efc4873e47ea0
parent70430001b74d0f67386a6b3642c857b3389cd5d0
Check always_inline flag in s390_can_inline_p [PR104327]

MASK_MVCLE is set for -Os but not for other optimization levels. In
general it should not make much sense to inline across calls where the
flag is different but we have to allow it for always_inline.

The patch also rearranges the hook implementation a bit based on the
recommendations from Jakub und Martin in the PR.

Bootstrapped and regression tested on s390x with various arch flags.
Will commit after giving a few days for comments.

gcc/ChangeLog:

PR target/104327
* config/s390/s390.cc (s390_can_inline_p): Accept a few more flags
if always_inline is set. Don't inline when tune differs without
always_inline.

gcc/testsuite/ChangeLog:

PR target/104327
* gcc.c-torture/compile/pr104327.c: New test.
gcc/config/s390/s390.cc
gcc/testsuite/gcc.c-torture/compile/pr104327.c [new file with mode: 0644]