public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christian Keil <c.keil@tu-harburg.de>
To: gcc-help@gcc.gnu.org
Subject: Re: Floating point optimizations
Date: Fri, 04 Apr 2008 15:48:00 -0000	[thread overview]
Message-ID: <47F61927.8030705@tu-harburg.de> (raw)
In-Reply-To: <20080403172718.GA4451@endeed2.ispras.ru>

Alexander Monakov schrieb:
> This transformation is indeed included into -ffast-math.  I checked with
> 
> $ gcc --version
> gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
> 
> and it does eliminate the calculation.  What does generated assembly code look
> like in your case?  Note you may as well check on this code:
> 
> double f(double a, double c)
> {
>   return c - (c - a);
> }
That's interesting. After your answer I checked with a gcc from Fedora
Core (Werewolf) and this removes it also. It seems like a backported
enhancement from vanilla gcc, version 4.3.0 does it as well.

Cheers,
Christian

-- 
Christian Keil                        /"\
Institute for Reliable Computing      \ /    ASCII Ribbon Campaign
Hamburg University of Technology       X  against HTML email & vCards
mail:c.keil@tu-harburg.de             / \

  reply	other threads:[~2008-04-04 12:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 17:00 Christian Keil
2008-04-03 17:27 ` John Fine
2008-04-04 12:04   ` Christian Keil
2008-04-03 18:24 ` Alexander Monakov
2008-04-04 15:48   ` Christian Keil [this message]
2008-04-05  1:15   ` Tim Prince
2008-04-05 13:07     ` Andrew Haley
2008-04-05 13:32       ` NightStrike
2008-04-05 19:05         ` Tim Prince
2008-04-05 21:26         ` me22

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=47F61927.8030705@tu-harburg.de \
    --to=c.keil@tu-harburg.de \
    --cc=gcc-help@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).