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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>:

https://gcc.gnu.org/g:c77230856eac2d28eb7bf10985846885c3c8727b

commit r12-1993-gc77230856eac2d28eb7bf10985846885c3c8727b
Author: Iain Buclaw <ibuc...@gdcproject.org>
Date:   Sat Jul 3 00:13:29 2021 +0200

    d: RHS value lost when a target_expr modifies LHS in a cond_expr

    To prevent the RHS of an assignment modifying the LHS before the
    assignment proper, a target_expr is forced so that function calls that
    return with slot optimization modify the temporary instead.  This did
    not work for conditional expressions however, to give one example.  So
    now the RHS is always forced to a temporary.

            PR d/101282

    gcc/d/ChangeLog:

            * d-codegen.cc (build_assign): Force target_expr on RHS for non-POD
            assignment expressions.

    gcc/testsuite/ChangeLog:

            * gdc.dg/torture/pr101282.d: New test.

Reply via email to