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

--- 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:54ec50bada94a8ff92edb04ee5216c27fa4bf942

commit r12-2565-g54ec50bada94a8ff92edb04ee5216c27fa4bf942
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/pr96429.d: Update test.
            * gdc.dg/pr101640.d: New test.

Reply via email to