From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, Alex Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile
Date: Tue, 01 Jul 2014 08:52:07 +0200 [thread overview]
Message-ID: <53B25A97.2070407@redhat.com> (raw)
In-Reply-To: <53B24A29.1030607@ozlabs.ru>
Il 01/07/2014 07:42, Alexey Kardashevskiy ha scritto:
> This is wrong actually. The problem here that compiler knows how to
> optimize constants. sin(0.0) is the one while log(0.0) is not (it is
> supposed to throw error or something as it the result is infinity).
>
> So the correct test here could be:
> int main(void) { volatile double x = 1; return isnan(sin(x)); }
>
> But I am afraid pretty soon compilers will learn how to optimize this as
> well :)
I think something like "double x; int f(void) {return isnan(sin(x));}"
should be bullet proof.
Paolo
next prev parent reply other threads:[~2014-07-01 6:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 1:51 [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile Alexey Kardashevskiy
2014-07-01 5:42 ` Alexey Kardashevskiy
2014-07-01 6:52 ` Paolo Bonzini [this message]
2014-07-01 8:19 ` Peter Maydell
2014-07-01 8:26 ` Paolo Bonzini
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=53B25A97.2070407@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.
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).