Skip to content

1 == 1 but 0 != 0 #5411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue May 4, 2002 · 8 comments
Closed

1 == 1 but 0 != 0 #5411

p5pRT opened this issue May 4, 2002 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented May 4, 2002

Migrated from rt.perl.org#9159 (status was 'resolved')

Searchable as RT9159$

@p5pRT
Copy link
Author

p5pRT commented May 4, 2002

From [email protected]

Created by [email protected]

I'll keep it short and sweet​:

----8<----snip----8<----
rain@​hmm​:/tmp$ perl -e 'print((1 == 1) . "\n");'
1
rain@​hmm​:/tmp$ perl -e 'print((0 == 0) . "\n");'

rain@​hmm​:/tmp$
----8<----snip----8<----

I put in the appropriate data below since I had to run perlbug on
another host (it failed to run on the problematic host due to the
bug.)

Other possibly relevant information​:
Linux version 2.4.18-rmk1-tux1 (root@​halcyon) (gcc version 2.95.3
20010315 (release)) #30 Tue Mar 5 21​:22​:35 CST 2002

rain@​hmm​:~$ perl -e 'print((0 eq 0) . "\n");'
1

I assumed the system library was to blame at first, but I was
unable to get strto<f,d,l> to misbehave (I haven't gone troving
through perl's source to see what means it uses to convert the
numbers...).

Perl Info

Flags:
    category=core
    severity=critical

Site configuration information for perl v5.6.1:

Configured by bod at Fri Jan 11 04:14:18 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.2.19, archname=arm-linux
    uname='linux europa 2.2.19 #1 sun apr 15 23:02:03 bst 2001 armv4l
unknown '
    config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC
-Darchname=arm-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1
-Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr
-Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1
-Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib
-Dlibperl=libperl.so.5.6.1 -Dd_dosuid -Doptimize=-O1 -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O1',
    cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20011006 (Debian prerelease)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
    perllibs=-ldl -lm -lc -lcrypt
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=true,
libperl=libperl.so.5.6.1
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jan 17 2002 09:02:54
  @INC:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl
    .

Locally applied patches:



@INC for perl v5.6.1:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl
    .


Environment for perl v5.6.1:
    HOME=/home/rain
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
   
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
    PERL_BADLANG (unset)
    SHELL=/bin/bash




@p5pRT
Copy link
Author

p5pRT commented May 4, 2002

From @nwc10

On Sat, May 04, 2002 at 02​:35​:31AM -0500, Ben Winslow wrote​:

This is a bug report for perl from rain@​bluecherry.net,
generated with the help of perlbug 1.33 running under perl v5.6.1.

-----------------------------------------------------------------
[Please enter your report here]

I'll keep it short and sweet​:

----8<----snip----8<----
rain@​hmm​:/tmp$ perl -e 'print((1 == 1) . "\n");'
1
rain@​hmm​:/tmp$ perl -e 'print((0 == 0) . "\n");'

perl5.6.1 -e 'print((0 == 0) . "\n");'
1

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration​:
  Platform​:
  osname=linux, osvers=2.2.13, archname=arm-linux
  uname='linux medusa 2.2.13 #334 wed dec 29 04​:49​:54 gmt 1999 armv3l unknown '
  config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=arm-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Dotherlibdirs=/usr/lib/perl5/5.6​:/usr/lib/perl5/5.005 -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -Doptimize=-O1 -des'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler​:
  cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O1',
  cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
  ccversion='', gccversion='2.95.4 20010604 (Debian prerelease)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt
  perllibs=-ldl -lm -lc -lcrypt
  libc=/lib/libc-2.2.3.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
  cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: USE_LARGE_FILES
  Built under linux
  Compiled at Jun 24 2001 04​:22​:44
  @​INC​:
  /usr/local/lib/perl/5.6.1
  /usr/local/share/perl/5.6.1
  /usr/lib/perl5
  /usr/share/perl5
  /usr/lib/perl/5.6.1
  /usr/share/perl/5.6.1
  /usr/local/lib/site_perl/arm-linux
  /usr/local/lib/site_perl
  /usr/lib/perl5/5.6
  /usr/lib/perl5/5.005/arm-linux
  /usr/lib/perl5/5.005
  .

rain@​hmm​:/tmp$
----8<----snip----8<----

I put in the appropriate data below since I had to run perlbug on
another host (it failed to run on the problematic host due to the
bug.)

Other possibly relevant information​:
Linux version 2.4.18-rmk1-tux1 (root@​halcyon) (gcc version 2.95.3
20010315 (release)) #30 Tue Mar 5 21​:22​:35 CST 2002

rain@​hmm​:~$ perl -e 'print((0 eq 0) . "\n");'
1

I assumed the system library was to blame at first, but I was
unable to get strto<f,d,l> to misbehave (I haven't gone troving
through perl's source to see what means it uses to convert the
numbers...).

I still doubt it's a perl bug. Almost everything I've ever hit on arm has
either been K StrongARM bugs (I have a K) or gcc optimiser bugs.

I've just run that perl -V on​:

Linux Bagpuss.unfortu.net 2.4.17-rmk1 #3 Thu Jan 10 14​:16​:59 GMT 2002 armv4l unknown

Do you have NWFPE or FAST_FPE? Having just RTFM it seems that FAST_FPE is now
full precision, but I've not tried it since it wasn't full precision, and
therefore definitely wasn't suitable for perl. The result I gave above was
NWFPE.

perl will be using strtoul (this section of toke.c)​:

  if (!floatit) {
  IV iv;
  UV uv;
  errno = 0;
  if (*PL_tokenbuf == '-')
  iv = Strtol(PL_tokenbuf, (char**)NULL, 10);
  else
  uv = Strtoul(PL_tokenbuf, (char**)NULL, 10);
  if (errno)
  floatit = TRUE; /* Probably just too large. */
  else if (*PL_tokenbuf == '-')
  sv_setiv(sv, iv);
  else if (uv <= IV_MAX)
  sv_setiv(sv, uv); /* Prefer IVs over UVs. */
  else
  sv_setuv(sv, uv);
  }

in 5.6.1. [All this stuff changes in 5.8]

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration​:
Platform​:
osname=linux, osvers=2.2.19, archname=arm-linux
uname='linux europa 2.2.19 #1 sun apr 15 23​:02​:03 bst 2001 armv4l
unknown '

I forget what europa is, but if things are so bad that 0 != 0, then I
can't believe that the regression test won't pass, or for that matter the
build would even complete.

I suspect it's some combination of things on your particular ARM system
causing it, but that's not to say there is no problem, as many other people
might be about to reach the same combination of things and hence hit this.

Nicholas Clark
--
Even better than the real thing​: http​://nms-cgi.sourceforge.net/

@p5pRT
Copy link
Author

p5pRT commented May 4, 2002

From @schwern

On Sat, May 04, 2002 at 02​:35​:31AM -0500, Ben Winslow wrote​:

I'll keep it short and sweet​:

----8<----snip----8<----
rain@​hmm​:/tmp$ perl -e 'print((1 == 1) . "\n");'
1
rain@​hmm​:/tmp$ perl -e 'print((0 == 0) . "\n");'

schwern@​blackrider​:~$ bleadperl -we 'print((0 == 0) . "\n");'
1
schwern@​blackrider​:~$ perl -we 'print((0 == 0) . "\n");'
1
schwern@​blackrider​:~$ perl5.6.1 -we 'print((0 == 0) . "\n");'
1
schwern@​blackrider​:~$ perl5.6.0 -we 'print((0 == 0) . "\n");'
1
schwern@​blackrider​:~$ perl5.005_03 -we 'print((0 == 0) . "\n");'
1

"perl" above is Debian's perl. The rest are home rolled.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration​:
  Platform​:
  osname=linux, osvers=2.4.17-rc1-ben0+xfs, archname=powerpc-linux
  uname='linux vir 2.4.17-rc1-ben0+xfs #1 thu dec 20 10​:06​:24 est 2001 ppc unknown '
  config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=powerpc-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -des'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler​:
  cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
  ccversion='', gccversion='2.95.4 (Debian prerelease)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
  perllibs=-ldl -lm -lc -lcrypt
  libc=/lib/libc-2.2.4.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
  cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: USE_LARGE_FILES
  Built under linux
  Compiled at Jan 11 2002 04​:28​:50
  %ENV​:
  PERL5LIB="/home/schwern/lib/perl5/site_perl"
  @​INC​:
  /home/schwern/lib/perl5/site_perl/5.6.1
  /home/schwern/lib/perl5/site_perl/5.6.0
  /home/schwern/lib/perl5/site_perl
  /usr/local/lib/perl/5.6.1
  /usr/local/share/perl/5.6.1
  /usr/lib/perl5
  /usr/share/perl5
  /usr/lib/perl/5.6.1
  /usr/share/perl/5.6.1
  /usr/local/lib/site_perl/powerpc-linux
  /usr/local/lib/site_perl
  /usr/local/share/perl/5.6.0
  .

--

Michael G. Schwern <schwern@​pobox.com> http​://www.pobox.com/~schwern/
Perl Quality Assurance <perl-qa@​perl.org> Kwalitee Is Job One
Don't make me come over there.

@p5pRT
Copy link
Author

p5pRT commented May 5, 2002

From [Unknown Contact. See original ticket]

Created by [email protected]

I'll keep it short and sweet​:

----8<----snip----8<----
rain@​hmm​:/tmp$ perl -e 'print((1 == 1) . "\n");'
1
rain@​hmm​:/tmp$ perl -e 'print((0 == 0) . "\n");'

rain@​hmm​:/tmp$
----8<----snip----8<----

I put in the appropriate data below since I had to run perlbug on
another host (it failed to run on the problematic host due to the
bug.)

Other possibly relevant information​:
Linux version 2.4.18-rmk1-tux1 (root@​halcyon) (gcc version 2.95.3
20010315 (release)) #30 Tue Mar 5 21​:22​:35 CST 2002

rain@​hmm​:~$ perl -e 'print((0 eq 0) . "\n");'
1

I assumed the system library was to blame at first, but I was
unable to get strto<f,d,l> to misbehave (I haven't gone troving
through perl's source to see what means it uses to convert the
numbers...).

Perl Info

Flags:
    category=core
    severity=critical

Site configuration information for perl v5.6.1:

Configured by bod at Fri Jan 11 04:14:18 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.2.19, archname=arm-linux
    uname='linux europa 2.2.19 #1 sun apr 15 23:02:03 bst 2001 armv4l
unknown '
    config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC
-Darchname=arm-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1
-Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr
-Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1
-Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib
-Dlibperl=libperl.so.5.6.1 -Dd_dosuid -Doptimize=-O1 -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O1',
    cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20011006 (Debian prerelease)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
    perllibs=-ldl -lm -lc -lcrypt
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=true,
libperl=libperl.so.5.6.1
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jan 17 2002 09:02:54
  @INC:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl
    .

Locally applied patches:



@INC for perl v5.6.1:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl
    .


Environment for perl v5.6.1:
    HOME=/home/rain
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
   
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2002

From @nwc10

On Sat, May 04, 2002 at 11​:08​:43PM -0500, Ben Winslow wrote​:

This turned out to be a problem with CONFIG_FPE_FASTFPE
(CONFIG_FPE_NWFPE works fine.) Thanks to everyone who provided insight
into the problem.

On Mon, Jun 17, 2002 at 11​:32​:21AM -0700, Tony Lindgren wrote​:

* mallum <breakfast@​10.am> [020614 07​:13]​:

I too have this exact same problem on a CATS machine running debian
unstable ( kernel 2.4.18-rmk6 ).

Is the only fix to link to debug-perl ?

-- Matthew

Hi,

Well, I finally got around to verifying that this is caused by the Fast
Floating Point Emulator. So the real solution is to use the Netwinder
Floating Point Emulator. Symlinking perl to debug-perl seems to be a
work around with the Fast Floating Point Emulator.

In any case, it's weird how the FastFPE works with debug-perl and not
with perl...

Tony

I wasn't aware of anyone getting this down to a test case.
The problem seems to be saving a floating point register containing 0 to
memory, and then reloading it. The same binaries give​:

nick@​Bagpuss [test]$ ./is_zero
1
nick@​Bagpuss [test]$ ./is_one
1
nick@​Bagpuss [test]$ dmesg | grep -i Floating
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com

nick@​Bagpuss [test]$ ./is_zero
0
nick@​Bagpuss [test]$ ./is_one
1
nick@​Bagpuss [test]$ dmesg | grep -i Floating
Fast Floating Point Emulator V0.9 (c) Peter Teichmann.

If I take the lfmfd out from this then it all works as expected on FastFPE

  mvfd f1, #0
  sfmfd f1, 1, [sp]!
  lfmfd f1, 1, [sp]!
  mvfd f0, #0
  cmf f0, f1

nick@​Bagpuss [test]$ ./is_zero_noload
1

Attached are source for is_zero and is_one

Nicholas Clark
--
Even better than the real thing​: http​://nms-cgi.sourceforge.net/

@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2002

From @nwc10

@​ Generated by gcc 2.95.4 20010319 (Debian prerelease) for ARM/elf
  .file "temp.c"
gcc2_compiled.​:
..section .rodata
  .align 2
..LC0​:
  .ascii "%d\012\000"
..text
  .align 2
  .global main
  .type main,function
main​:
  @​ args = 0, pretend = 0, frame = 0
  @​ frame_needed = 1, current_function_anonymous_args = 0
  mov ip, sp
  stmfd sp!, {r4, fp, ip, lr, pc}
  sub fp, ip, #4
  mvfd f1, #0
  sfmfd f1, 1, [sp]!
  lfmfd f1, 1, [sp]!
  mvfd f0, #0
  cmf f0, f1
  movne r1, #0
  moveq r1, #1
  ldr r0, .L149
  bl printf
..L150​:
  .align 2
..L149​:
  .word .LC0
..L148​:
  mov r0, #0
  ldmea fp, {r4, fp, sp, pc}
..Lfe2​:
  .size Perl_pp_eq,.Lfe2-Perl_pp_eq
  .ident "GCC​: (GNU) 2.95.4 20010319 (Debian prerelease)"

@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2002

From @nwc10

@​ Generated by gcc 2.95.4 20010319 (Debian prerelease) for ARM/elf
  .file "temp.c"
gcc2_compiled.​:
..section .rodata
  .align 2
..LC0​:
  .ascii "%d\012\000"
..text
  .align 2
  .global main
  .type main,function
main​:
  @​ args = 0, pretend = 0, frame = 0
  @​ frame_needed = 1, current_function_anonymous_args = 0
  mov ip, sp
  stmfd sp!, {r4, fp, ip, lr, pc}
  sub fp, ip, #4
  mvfd f1, #1
  sfmfd f1, 1, [sp]!
  lfmfd f1, 1, [sp]!
  mvfd f0, #1
  cmf f0, f1
  movne r1, #0
  moveq r1, #1
  ldr r0, .L149
  bl printf
..L150​:
  .align 2
..L149​:
  .word .LC0
..L148​:
  mov r0, #0
  ldmea fp, {r4, fp, sp, pc}
..Lfe2​:
  .size Perl_pp_eq,.Lfe2-Perl_pp_eq
  .ident "GCC​: (GNU) 2.95.4 20010319 (Debian prerelease)"

@p5pRT
Copy link
Author

p5pRT commented Jul 1, 2002

From [Unknown Contact. See original ticket]

* Nicholas Clark <nick@​unfortu.net> [020629 10​:26]​:

I wasn't aware of anyone getting this down to a test case.
The problem seems to be saving a floating point register containing 0 to
memory, and then reloading it. The same binaries give​:

nick@​Bagpuss [test]$ ./is_zero
1
nick@​Bagpuss [test]$ ./is_one
1
nick@​Bagpuss [test]$ dmesg | grep -i Floating
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com

nick@​Bagpuss [test]$ ./is_zero
0
nick@​Bagpuss [test]$ ./is_one
1
nick@​Bagpuss [test]$ dmesg | grep -i Floating
Fast Floating Point Emulator V0.9 (c) Peter Teichmann.

If I take the lfmfd out from this then it all works as expected on FastFPE

Cool! That was somewhat painful to narrow down to a test case :)

Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant