mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: for information, gcc-4.2.3 miscompiles musl math
Date: Sat, 21 Nov 2015 14:51:44 -0500	[thread overview]
Message-ID: <20151121195144.GF3818@brightrain.aerifal.cx> (raw)
In-Reply-To: <20151121194132.GF23362@port70.net>

On Sat, Nov 21, 2015 at 08:41:32PM +0100, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2015-11-21 14:25:48 -0500]:
> 
> > On Sat, Nov 21, 2015 at 06:24:18PM +0100, u-uy74@aetey.se wrote:
> > > Good to be aware of:
> > > gcc-4.2.3 miscompiles musl math since at least 1.1.6,
> > > tested while targeting i486,
> > > 1.0.x seems to have been alright.
> > > 
> > > The symptom is that sin(larger-than-2*pi) yields large values
> > > like "sin(8.000000) = 21.709544".
> > > Looks like the argument reduction logic has changed in a way
> > > which is not compatible with gcc-4.2.3.
> > 
> > Are you using configure or a hand-written config.mak? configure sets
> > up a big hammer, -ffloat-store, when -fexcess-precision=standard is
> > not supported (i.e. on old gcc), which hopefully suffices to make this
> > code work, but it's possible it doesn't always do the job.
> > 
> 
> i think this change might be it:
> http://git.musl-libc.org/cgit/musl/commit/?id=0ce946cf808274c2d6e5419b139e130c8ad4bd30
> 
> the new code avoids an extra store,
> but then i rely on the evaluation
> being in long double.
> 
> with -ffloat-store this breaks,
> adding extra store rounds at the
> wrong place.

Hmm, which places does it add the stores around? Could you fix it with
an explicit conversion to double_t? That might be nice to harden
against broken compilers without penalizing correct ones.

Rich


  parent reply	other threads:[~2015-11-21 19:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 17:24 u-uy74
2015-11-21 19:25 ` Rich Felker
2015-11-21 19:41   ` Szabolcs Nagy
2015-11-21 19:49     ` Rich Felker
2015-11-21 19:56       ` Szabolcs Nagy
2015-11-21 19:51     ` Rich Felker [this message]
2015-11-21 20:03       ` Szabolcs Nagy
2015-11-21 20:15         ` Rich Felker
2015-11-21 21:54           ` Szabolcs Nagy
2015-11-21 20:32         ` u-uy74
2015-11-21 20:11   ` u-uy74
2015-11-21 20:18     ` Rich Felker
2015-11-21 20:30     ` Alexander Monakov
2015-11-21 21:08       ` u-uy74
2015-11-22  4:00     ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151121195144.GF3818@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).