https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91501
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to BCartier from comment #5)
> Thanks for the heads up, nice to know a fix could be possible.
>
> As for the const reference in doStuff, do you mean
>
> void __attribute__((noinline)) doStuff(const struct TestStruct &myStruct)
> {
> ...
> }
>
> ?
Yes.
>
> By doing so, wouldn't you use the address of a temporary variable (created
> by the macro and the function) ?
Yes. But note myStruct was already passed by reference so it does not change
that much. And that temp goes out of scope after the statement is done.