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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
As usual this is sign-extension behavior of wide-ints that does not exactly
match double-ints.  tree_fold_binomial likes to do infinite precision math.
The int_fits_type_p check below is not effective as wide_int_to_tree
truncates the value to be in-range.

  /* Result = Numerator / Denominator.  */
  wide_int di_res = wi::udiv_trunc (num, denom);
  res = wide_int_to_tree (type, di_res);
  return int_fits_type_p (res, type) ? res : NULL_TREE;

I have a patch restoring previous behavior.  IMHO the whole chrec_evaluate
should use GMP, there is no need to give up - the final truncation is still
valid.

Reply via email to