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

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
This is the new code I am using:
```
  // If the result is varying, Use the type min/max if either is not
  // the full precision min/max. This helps with strict enum
  // and g++.dg/warn/pr33738.C.
  if (res && r.varying_p () && INTEGRAL_TYPE_P (r.type ()))
    {
      irange &ir = as_a <irange> (r);
      tree type = r.type ();
      auto typemax = wi::to_wide (TYPE_MAX_VALUE (type));
      auto typemin = wi::to_wide (TYPE_MIN_VALUE (type));
      auto precisionmax = wi::max_value (TYPE_PRECISION (type),
                                         TYPE_SIGN (type));
      auto precisionmin = wi::min_value (TYPE_PRECISION (type),
                                         TYPE_SIGN (type));
      if (typemax != precisionmax || typemin != precisionmin)
        ir.set (type, typemin, typemax);
    }
```

This basically does the same as before when TYPE_UNSIGNED (r.type ()) was true
(well assuming typemin was 0) but now I think this handles signed.

I need to find a place where I can test Ada ...

Reply via email to