https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101640
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:9a16492f524eb46b4ba0375d2e2ebe0f62b72fa4 commit r10-10008-g9a16492f524eb46b4ba0375d2e2ebe0f62b72fa4 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)