> Am 27.06.2024 um 19:43 schrieb Iain Sandoe <i...@sandoe.co.uk>:
>
>
>> On 27 Jun 2024, at 14:51, Iain Sandoe <i...@sandoe.co.uk> wrote:
>>
>> If I declare a function __attribute__((noipa, optimize (“-O0”))), I was
>> kinda expecting that it would not be optimized at all ..
>>
>> however it does not seem to prevent functions called by it from being
>> inlined into its body ..
>>
>> am I missing some additional constraint that should be added?
>>
>> (I explicitly want to avoid called functions being inlined into the body,
>> but cannot mark _those_ functions as noinline)
>
> Additional: If I compile the entire code “O0” then all behaves as expected.
>
> The issue seems to be when compiing (say) O2 and a function has a local
> optimisation set lower (O0) ..
> perhaps this is a target problem ..
> although looking at say tree-ssa-ccp.cc I do not see any gating on the
> optimisation level - which I guess suggests once it’s selected in the stack
> .. it’s going to run…
>
> any insights would be welcome.
It might be that we do not honor -O0 in the caller this way during IPA
inlining. I would guess it correctly disables early inlining into it though.
It sounds like a bug to me.
Richard
> Iain
>
>