------- Comment #18 from singler at gcc dot gnu dot org 2009-10-23 10:00 ------- (In reply to comment #17) > Is something known about the actual size of a, b, and c?
They can be as large as the input size. > Also, I don't know which is the required precision for the result: must be > exact if representable? In the last iteration, __n == 0 => __total == __N, and then, the result must absolutely be __rank, according to the specification. Anyway, I think I have found a solution that is easier, faster, and avoids the large intermediate altogether (see attached patch). It also fixes similar problems in two other locations. However, this patch needs further thorough testing. Also, __n == 2 ^ __r - 1, so __n + 1 == 2 ^ __r, and the divisions could be replaced by shifts. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40852