public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] x86: Ignore OPTION_MASK_ISA_64BIT for -m32 when inlining
Date: Mon, 14 Mar 2022 06:53:09 -0700	[thread overview]
Message-ID: <CAMe9rOogGO3P7t3mrMW15-UkRDjr6QP6OqXRYUi+7KOB6wnztQ@mail.gmail.com> (raw)
In-Reply-To: <20220314134901.1252090-1-hjl.tools@gmail.com>

On Mon, Mar 14, 2022 at 6:49 AM H.J. Lu <hjl.tools@gmail.com> 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.

  reply	other threads:[~2022-03-14 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 13:49 H.J. Lu
2022-03-14 13:53 ` H.J. Lu [this message]
2022-03-14 14:03 ` Jakub Jelinek
2022-03-14 14:32   ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOogGO3P7t3mrMW15-UkRDjr6QP6OqXRYUi+7KOB6wnztQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).