https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104327
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The testcase should be in a generic directory, so that we catch it on other
targets too.
Note, e.g. i386/ can_inline_p hook is quite different from this one.
E.g. for the ISA options it allows the caller to have a superset of the ISAs:
/* Callee's isa options should be a subset of the caller's, i.e. a SSE4
function can inline a SSE2 function but a SSE2 function can't inline
a SSE4 function. */
if (((caller_opts->x_ix86_isa_flags & callee_opts->x_ix86_isa_flags)
!= callee_opts->x_ix86_isa_flags)
|| ((caller_opts->x_ix86_isa_flags2 & callee_opts->x_ix86_isa_flags2)
!= callee_opts->x_ix86_isa_flags2))
ret = false;
which is heavily relied on (e.g. most of the intrinsics have some ISA and
we allow inlining if the caller supports those), takes into account whether
it always_inline callee, etc. Now, s390 does something like that e.g. with the
arch.
target_flags seem to be a mixed bag of features:
#define MASK_64BIT (1U << 0)
#define MASK_BACKCHAIN (1U << 1)
#define MASK_DEBUG_ARG (1U << 2)
#define MASK_ZARCH (1U << 3)
#define MASK_HARD_DFP (1U << 4)
#define MASK_SOFT_FLOAT (1U << 5)
#define MASK_OPT_HTM (1U << 6)
#define MASK_LONG_DOUBLE_128 (1U << 7)
#define MASK_MVCLE (1U << 8)
#define MASK_PACKED_STACK (1U << 9)
#define MASK_SMALL_EXEC (1U << 10)
#define MASK_OPT_VX (1U << 11)
#define MASK_ZVECTOR (1U << 12)
I'd say e.g. OPT_VX or OPT_HTM seem to me like ISA flags that could be treated
that way, MVCLE is an tuning option from what I understand (s390 doesn't check
*_tune at all, maybe it could for non-always_inline?), e.g. 64BIT or
LONG_DOUBLE_128 seems to be an ABI option so any changes should make code
uninlinable, ...