https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78193
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> This looks related to the ABI and was introduced by:
>
> r241765 | jason | 2016-11-02 02:50:29 +0100 (Wed, 02 Nov 2016) | 53 lines
>
> Implement P0136R1, Rewording inheriting constructors.
The problem comes from build_over_call:
if (current_function_decl
&& flag_new_inheriting_ctors
&& DECL_INHERITED_CTOR (current_function_decl)
&& cand->num_convs)
/* Don't introduce copies when passing arguments along to the inherited
constructor. */
CALL_FROM_THUNK_P (call) = true;
For the inherited constructor:
B::B(moveonly) [inherited from A] (struct B * const this, struct moveonly
D.1999)
{
struct moveonly D.2080;
struct moveonly D.2053;
<bb 2>:
A::A (this_2(D), D.2080);
return;
}
D.2080 is passed indirectly in the call but was not initially TREE_ADDRESSABLE
so its RTL was already set to a REG before mark_addressable is invoked on it.
On the contrary, when CALL_FROM_THUNK_P is not set, a stack temporary is built
and passed in the call instead, which is naturally addressable.