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

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

https://gcc.gnu.org/g:0513528fe9eae642338089a84414e99faf49cbee

commit r9-9651-g0513528fe9eae642338089a84414e99faf49cbee
Author: Iain Buclaw <ibuc...@gdcproject.org>
Date:   Tue Jul 27 13:24:34 2021 +0200

    d: Wrong evaluation order of binary expressions (PR101640)

    The use of fold_build2 can in some cases swap the order of its operands
    if that is the more optimal thing to do.  However this breaks semantic
    guarantee of left-to-right evaluation in D.

            PR d/101640

    gcc/d/ChangeLog:

            * expr.cc (binary_op): Use build2 instead of fold_build2.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr101640.d: New test.

    (cherry picked from commit 54ec50bada94a8ff92edb04ee5216c27fa4bf942)

Reply via email to