inlining failed in call to 'always_inline': target specific option mismatch

Richard Biener richard.guenther@gmail.com
Wed May 24 09:28:34 GMT 2023


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


More information about the Gcc mailing list