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

            Bug ID: 111668
           Summary: vrp2 introduces invalid wide Boolean values
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kristerw at gcc dot gnu.org
  Target Milestone: ---

The vrp2 pass introduces an invalid wide Boolean when compiling the function

  int *a, b, c, d;
  void
  foo (void)
  {
    for (; d <= 0; d++)
      b &= ((a || d) ^ c) == 1;
  }

What is happening is that vrp2 changes the IR

  _Bool _16;
  <signed-boolean:32> _66;

  gimple_assign <cond_expr, _66, _16, -1, 0>

to the incorrect

  _Bool _16;
  <signed-boolean:32> _38;
  <signed-boolean:32> _66;

  gimple_assign <nop_expr, _38, _16, NULL, NULL>
  gimple_assign <negate_expr, _66, _38, NULL, NULL>

Reply via email to