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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
A big hammer solution might be to treat flag_rounding_math in frange::set the
same as
!HONOR_SIGNED_ZEROS, i.e. always extend [0, x] ranges to [-0, x] and [y, -0] to
[y, 0]
because we don't know what the rounding will do:
-  else if (!HONOR_SIGNED_ZEROS (m_type))
+  else if (!HONOR_SIGNED_ZEROS (m_type) || flag_rounding_math)
     {
       if (real_iszero (&m_max, 1))
         m_max.sign = 0;
       if (real_iszero (&m_min, 0))
         m_min.sign = 1;
     }
Though, such a change would affect even say operator_abs handling where we even
for flag_rounding_math are guaranteed the sign will be positive (unless
-fno-signed-zeros, in that case it is right we don't assume anything).
Or do it in range_operator::fold_range?  Or some other spot?
Generally, operations like neg, abs, comparisons should be fine, but +-*/ at
least in the fold_range direction probably need to do that.

Reply via email to