This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libgcc2 __fixsfdi
On Sat, Oct 05, 2002 at 12:22:44AM +0930, Alan Modra wrote:
> gcc's __fixsfdi function returns extremely surprising results for
> floats that overflow the range of DWtype. The integer value
> wraps rather than limiting to min/max values.
Well, rather it crops to the unsigned max and then wraps.
Surprisingly, while implementing the new real.c, I found
that something in gcc relied on this. I forget what,
exactly, but if you change real_to_integer (which returns
a signed result) to crop to the maximum signed integer
(rather than wrapping), you'll get some test suite failures.
I hadn't been interested in understanding why at the time.
But we should if we go making this sort of change, we should
be consistent between runtime and compiletime, which means
addressing this half-remembered failure.
r~