https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118169

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On the above reduced testcase, this is in the 3rd cxx_eval_outermost_expression
call when object is non-NULL, in the first two cases TREE_TYPE (object) and
initialized_type (t) are the same, but in the third case TREE_TYPE (object) is
B and initialized_type (t) is VOID_TYPE.
constexpr_dtor is false, so before the change we'd take the if (VOID_TYPE_P
(type)) path, the !constexpr_dtor case in there, cxx_dialect < cxx20 and just
return t.
Now we just try to evaluate it with the B type.
Except that t is just random sequence of initialization statements for the
TARGET_EXPR <D.2912, D.2912 = {.u=0}, <<< Unknown tree: expr_stmt
  D.2912.t = TARGET_EXPR <D.2911, <<< Unknown tree: aggr_init_expr
    5
    __ct_comp 
    D.2911
    (struct A *) <<< Unknown tree: void_cst >>>
    (int *) x >>>> >>>;
TARGET_EXPR <D.2922, 1>;
D.2922 = 0;>;
TARGET_EXPR, the COMPOUND_EXPR has void_type_node, and so do the individual
statements; just the final MODIFY_EXPR (D.2922 = 0; in there) wasn't for
whatever reason converted to void and so has BOOLEAN_TYPE and we then just try
to set D.2912 to false.
But that is wrong, we shouldn't be converting that to the object type, as it is
just sequence of void statements.
I must say I don't really understand the r15-6369 change.

Reply via email to