Date: Mon, 1 Mar 2010 06:23:30 +1100 From: Peter Jeremy <peterjeremy@acm.org> To: freebsd-sparc64@freebsd.org Subject: gcc code generation problems Message-ID: <20100228192329.GA68252@server.vk2pj.dyndns.org>
next in thread | raw e-mail | index | archive | help
--61jdw2sOBCFtR2d/ Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've been trying to use FreeBSD 8-stable from a couple of weeks ago on a SunBlade 1500 to investigate some perl problems I'm seeing on Solaris and have bumped into different and more worrying problems on FreeBSD. In particular, the test program used to determine the number of fraction bits in a double (slightly adapted variant attached) is getting the wrong answer. (The command in the comment reflects the compilation flags used by perl). The correct answer is '53', but if optimisation is enabled, I'm getting '51' instead. Disabling the printf() and/or using -fno-strict-aliasing has no effect. $ cc -DXXX -O tryfp.c; ./a.out a 4503599627370495 !=3D 0 51 $ cc -DXXX -O2 tryfp.c; ./a.out a 4503599627370495 !=3D 0 51 $ cc -DXXX tryfp.c; ./a.out a 18014398509481983 !=3D 18014398509481984 53 $=20 I have captured the asm output from those 3 optimisation levels and can see that they are different but I'm still trying to work out the exact differences. For anyone with perl installed, this is the value of nv_preserves_uv_bits in $LOCALBASE/lib/perl5/5.8.?/mach/Config_heavy.pl I would appreciate any comments/suggestions. --=20 Peter Jeremy --EVF5PPMfhYS0aIcm-- --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkuKwrEACgkQ/opHv/APuIfJAwCgmtE2iuea4AJdC8FrWbd8AK3q GoYAoICgcXgIidHEkfQe4mOJcK3uvwph =1FQ3 -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100228192329.GA68252>