Re: OpenBSD failures: OS bug, Compiler bug, or Perl bug?

[email protected] (Yitzchak Scott-Thoennes) Wed, 28 Apr 2004 00:10:07 -0700
Newsgroups perl.perl5.porters,perl.daily-build
Organization bs"d
Message-ID <[email protected]>
On Mon, Apr 26, 2004 at 07:33:09AM +0200, Marcus Holland-Moritz <[email protected]> wrote:
> Ok, I found it... :)

Good job!

> Looking at the generated assembly code revealed that casting 'double'
> to 'unsigned long long' calls __fixunsdfdi(). GCC implements this
> function, as does OpenBSD's libc (!). Now, the cool thing is that
> casting works as long as you do _not_ link libc to your executable.
> I you do (and Perl does), you start getting wrong results for values
> larger 2**32:

Does openbsd libc also have a buggy __fixunsxfdi?  If not, a workaround
would be assigning to a long double and then casting to unsigned long long.