public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Georg-Johann Lay <avr@gjlay.de>
Cc: gcc@gcc.gnu.org
Subject: Re: inlining failed in call to 'always_inline': target specific option mismatch
Date: Wed, 24 May 2023 11:28:34 +0200	[thread overview]
Message-ID: <CAFiYyc28q3mC8Ss0w2+N87ghDOm5NMNQugNR30NdJ9qNgn0x4Q@mail.gmail.com> (raw)
In-Reply-To: <7a3552f0-ac4d-754f-a7ba-cba3ff9a4a41@gjlay.de>

On Tue, May 23, 2023 at 1:25 PM Georg-Johann Lay <avr@gjlay.de> wrote:
>
> This error pops up in the testsuite for avr.
>
> As far as I understand, this is due to target-specific optimization like
> in avr-common.cc:
>
>      { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_mgas_isr_prologues, NULL, 1 },
>      { OPT_LEVELS_1_PLUS, OPT_mmain_is_OS_task, NULL, 1 },
>      // Stick to the "old" placement of the subreg lowering pass.
>      { OPT_LEVELS_1_PLUS, OPT_fsplit_wide_types_early, NULL, 1 },

For testcases that have say __attribute__(optimize(0))?  Do you have a specific
example?

> My question is how to fix this.
>
> The backend does not implement can_inline_p, and adding "Optimization"
> to the respective option definition in avr.opt does not help.

I think you'd need to implement the target hook and at least handle
the mismatches of target options you want to allow for inlining,
otherwise the default implementations rejects any mismatch, so
for example when a function has -mgas-isr-prologues but a callee
has not it will never inline that (not even with always-inline I think).

Richard.

> Johann

  parent reply	other threads:[~2023-05-24  9:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 11:24 Georg-Johann Lay
2023-05-23 12:55 ` [patch]: Implement PR104327 for avr Georg-Johann Lay
2023-05-24  9:38   ` Richard Biener
2023-05-24 15:44     ` Georg-Johann Lay
2023-05-25  6:35       ` Richard Biener
2023-05-25 14:22         ` Georg-Johann Lay
2023-05-25 15:07           ` Richard Biener
2023-05-24  9:28 ` Richard Biener [this message]
2023-05-24 15:52   ` inlining failed in call to 'always_inline': target specific option mismatch Georg-Johann Lay

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=CAFiYyc28q3mC8Ss0w2+N87ghDOm5NMNQugNR30NdJ9qNgn0x4Q@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=avr@gjlay.de \
    --cc=gcc@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).