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

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

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

--- Comment #7 from Drea Pinski <pinskia at gcc dot gnu.org> ---
So bitint has the same issue but bitfields are fine.


The check should be very similar to one in gimple_needing_rewrite_undefined:
```
  /* Boolean loads need special handling as they are treated as a full MODE
load
     and don't mask off the bits for the precision.  */
  if (gimple_assign_load_p (stmt)
      /* Booleans are the integral type which has this non-masking issue. */
      && TREE_CODE (lhs_type) == BOOLEAN_TYPE
      /* Only non mode precision booleans are need the masking.  */
      && !type_has_mode_precision_p (lhs_type)
      /* BFR should be the correct thing and just grab the precision.  */
      && TREE_CODE (rhs) != BIT_FIELD_REF
      /* Bit-fields loads don't need a rewrite as the masking
         happens for them.  */
      && (TREE_CODE (rhs) != COMPONENT_REF
          || !DECL_BIT_FIELD (TREE_OPERAND (rhs, 1))))
    return true;
```

Except for the removal of BOOLEAN_TYPE, it should just be INTEGRAL_TYPE_P
instead. (note the check in gimple_needing_rewrite_undefined might also need a
similar change too but I have not checked it yet).

Reply via email to