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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-07-25
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. introduced by my r14-6420-g85c5efcffed19c .

We go from:
  <bb 4> [local count: 1073741824]:
  if (value_7 == 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 6>; [50.00%]

  <bb 5> [local count: 536870912]:
<L2>:
  _6 = VIEW_CONVERT_EXPR<_Bool>(value$8_8);

  <bb 6> [local count: 1073741824]:
  # _2 = PHI <_6(5), 1(4)>

to:

  _6 = VIEW_CONVERT_EXPR<_Bool>(value$8_8);
  _12 = value_7 != 0;
  _13 = _6 | _12;

The VCE comes from SRA.

Now there is a few other issues here too.

First off If I change the switch to:
```
    if (value.type == VALUE_BOOLEAN)
      return value.boolean;
    return 1;
```

Then phiopt will move the VCE out of the if and then things will work; I should
try to understand what the difference there is.

Anyways this is for tomorrow or the weekend to solve. It won't be solved for
GCC 14.2.0 as that is already in RC1.

Reply via email to