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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  gimple_assign <ne_expr, _107, _2, 0, NULL>
  gimple_assign <cond_expr, e_36, _107, &MEM <char[3]> [(void *)&d + 2B], &MEM
<char[3]> [(void *)&d + 1B]>
  gimple_assign <pointer_diff_expr, _14, e_36, &d, NULL>


  gimple_assign <cond_expr, _14, _107, 2B, 1B>


Folding statement: e_36 = _107 ? &MEM <char[3]> [(void *)&d + 2B] : &MEM
<char[3]> [(void *)&d + 1B];
Not folded
Folding statement: _14 = e_36 - &d;
Applying pattern match.pd:3230, gimple-match-6.cc:12102
Applying pattern match.pd:3230, gimple-match-6.cc:12102
Applying pattern match.pd:8648, gimple-match-6.cc:13050
gimple_simplified to _14 = _107 ? 2B : 1B;
Folded into: _14 = _107 ? 2B : 1B;

I will take care of this.

It was introduced by r16-6484-gb01d6fa9759a48 . 

I think the problem is given:
```
/* Similar to above:
   (c ? a : b) op d  ->  c ? (a op d) : (b op d)
   But with non-vector binary ops, most of them non-commutative.  */
(for op (plus minus mult bit_and bit_ior bit_xor
         lshift rshift rdiv trunc_div ceil_div floor_div round_div exact_div
         trunc_mod ceil_mod floor_mod round_mod min max pointer_diff
         lrotate rrotate mult_highpart)
 (simplify
  (op (cond @0 @1 @2) @3)
  (cond @0 (op! @1 @3) (op! @2 @3)))

```

op! here should be op:type! for both of those.

This is not Daniel's fault for this knowing how the type is infered sometimes
incorrectly.

Reply via email to