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

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

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

commit r16-919-gee636671898c6bce63d9b2a698007b609aabbfe8
Author: Jason Merrill <ja...@redhat.com>
Date:   Fri May 23 09:41:25 2025 -0400

    fold: DECL_VALUE_EXPR isn't simple [PR120400]

    This PR noted that fold_truth_andor was wrongly changing && to & where the
    RHS is a VAR_DECL with DECL_VALUE_EXPR; we can't assume that such can be
    evaluated unconditionally.

    To be more precise we could recurse into DECL_VALUE_EXPR, but that doesn't
    seem worth bothering with since typical uses involve a COMPONENT_REF, which
    is not simple.

            PR c++/120400

    gcc/ChangeLog:

            * fold-const.cc (simple_operand_p): False for vars with
            DECL_VALUE_EXPR.

Reply via email to