On Mon, Mar 14, 2022 at 6:49 AM H.J. Lu <[email protected]> wrote:
>
> gcc/
>
> PR target/104890
> * config/i386/i386.cc (ix86_can_inline_p): Ignore
> OPTION_MASK_ISA_64BIT for -m32.
Please ignore this.
> gcc/testsuite/
>
> PR target/104890
> * gcc.target/i386/pr104890.c: New test.
> ---
> gcc/config/i386/i386.cc | 4 ++++
> gcc/testsuite/gcc.target/i386/pr104890.c | 11 +++++++++++
> 2 files changed, 15 insertions(+)
> create mode 100644 gcc/testsuite/gcc.target/i386/pr104890.c
>
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index 23bedea92bd..f2bb4765e5b 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -587,6 +587,10 @@ ix86_can_inline_p (tree caller, tree callee)
> if (TARGET_GENERAL_REGS_ONLY_P (callee_opts->x_ix86_target_flags))
> always_inline_safe_mask |= MASK_80387;
>
> + /* Ignore OPTION_MASK_ISA_64BIT for -m32. */
> + if (!TARGET_64BIT)
> + always_inline_safe_mask |= OPTION_MASK_ISA_64BIT;
> +
> cgraph_node *callee_node = cgraph_node::get (callee);
> /* 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
> diff --git a/gcc/testsuite/gcc.target/i386/pr104890.c
> b/gcc/testsuite/gcc.target/i386/pr104890.c
> new file mode 100644
> index 00000000000..cb430eef688
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/pr104890.c
> @@ -0,0 +1,11 @@
> +/* { dg-do compile { target ia32 } } */
> +/* { dg-options "-O2 -mshstk -march=i686" } */
> +
> +#include <x86gprintrin.h>
> +
> +__attribute__((target ("general-regs-only")))
> +int
> +foo ()
> +{
> + return _get_ssp ();
> +}
> --
> 2.35.1
>
--
H.J.