On Wed, Sep 11, 2024 at 12:38 PM Eric Botcazou <botca...@adacore.com> wrote:
>
> > Hmm, it looks to me that the IPA analysis marking the variable readonly
> > in the first place is wrong - or that NRV may not be applied to such a
> > variable later.  Is NRV ever applied to say
> >
> > static const S s = ...;
> >
> > s = foo ();
> >
> > thus a readonly declared LHS?
>
> But NRV is only an example and not necessary, as you may read a RESULT_DECL in
> the callee.  So the combination is actually just RSO + inlining if the callee
> happens to read RESULT_DECL.

Sure, but then the same argument is that with RSO marking the variable
as write-only
is wrong (or changing the call to use RSO for a write-only variable) -
unless the callee
never reads from RESULT_DECL.

Richard.

>
> --
> Eric Botcazou
>
>

Reply via email to