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

            Bug ID: 87023
           Summary: It's almost false, when c_fully_fold_internal deal
                    with C_MAYBE_CONST_EXPR.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: He.Hongjun at zte dot com.cn
  Target Milestone: ---

in c_fully_fold_internal, C_MAYBE_CONST_EXPR's initial value is false. later,
using add operations, it's value is always false.
  1. initial value
        if (C_MAYBE_CONST_EXPR_INT_OPERANDS (expr))
        {
          *maybe_const_itself = false; // the initial value is false
          inner = c_fully_fold_internal (inner, in_init, maybe_const_operands,
                                         maybe_const_itself, true);
        }
  2. add operations
    *maybe_const_itself &= op0_const_self;
    *maybe_const_itself &= op1_const_self;
    *maybe_const_itself &= op2_const_self;

  Whether the initial value should be true?

Reply via email to