develooper Front page | perl.perl5.porters | Postings from April 2013

Re: Blead on s390x

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
April 7, 2013 12:06
Subject:
Re: Blead on s390x
Message ID:
20130407120635.GM3729@plum.flirble.org
On Sun, Apr 07, 2013 at 02:03:28PM +0200, H.Merijn Brand wrote:

> > int main (int argc, char **argv) {
> >     union u var;
> >     double d;
> >     double d1;
> >     double d2;
> >     unsigned long uv = ~0;
> >     var.u = ~0;
> > 
> >     d = (double) var.u;
> >     d1 = (double) uv;
> >     d2 = (double) ~0UL;
> >     printf("d=%g d1=%g, d2=%g, cast is %g\n", d, d1, d2, (double) ~0UL);
> >     return 0;
> > }
> > 
> > 
> > does it agree with my local system, or does it think that some of those
> > are 9e18?
> 
> d=9.22337e+18 d1=9.22337e+18, d2=1.84467e+19, cast is 1.84467e+19
                   ^^^^^^^^^^^

Thanks. Bother. That's going to be hard to work around.

> > #11907 Looking for a compiler bug is the strategy of LAST resort.  LAST resort.
> 
> test@zdolinux:/perl> gcc --version
> gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
> Copyright (C) 2008 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> test@zdolinux:/perl> as --version
> GNU assembler (GNU Binutils; SUSE Linux Enterprise 11) 2.21.1
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `s390x-suse-linux'.

That compiler need fixing. It can't cast large unsigned integers to doubles
:-(

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About