This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20434] pessimization of complex expression
- From: "Thomas dot Koenig at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2005 09:45:57 -0000
- Subject: [Bug middle-end/20434] pessimization of complex expression
- References: <20050311215610.20434.Thomas.Koenig@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Thomas dot Koenig at online dot de 2005-03-12 09:45 -------
(In reply to comment #4)
> (In reply to comment #3)
> > > > - Why the casts to double?
> > > Because that is required by the C standard.
> >
> > Isn't that covered by the as-if rule? I'm fairly
> > sure the cast to double won't change the result of
> > the "<" operator :-)
> No but the addition is done in double.
Again, the as-if rule: If a and b are floats, the expression
a+b < 0 should be the same for any a and b regardless wether they
are done in float or double.
The same is true, for float a,b and c, of
c = a+b;
It is _not_ true for exmperssions like c = a+b-a, of course.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20434