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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|forwprop4 introduces        |[14 Regression] forwprop4
                   |invalid wide signed Boolean |introduces invalid wide
                   |values                      |signed Boolean values
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org
   Target Milestone|---                         |14.0
   Last reconfirmed|                            |2023-11-27
           Keywords|                            |wrong-code
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine.


```
/* (nop_outer_cast)-(inner_cast)var -> -(outer_cast)(var)
   if var is smaller in precision.
   This is always safe for both doing the negative in signed or unsigned
   as the value for undefined will not show up.  */
(simplify
 (convert (negate:s@1 (convert:s @0)))
 (if (INTEGRAL_TYPE_P (type)
      && tree_nop_conversion_p (type, TREE_TYPE (@1))
      && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (@0)))
    (negate (convert @0))))
```

This needs a check for !BOOLEAN_TYPE here I think. boolean is the special case
...

Reply via email to