This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/32172] Behavior of -ffast-math



------- Comment #5 from eres at il dot ibm dot com  2007-06-01 06:24 -------
(In reply to comment #3)
> > *** This bug has been marked as a duplicate of 28684 ***
> Related, but a different issue. 

I Agree.  Bug 28684 mainly deals with the need to redefine
-funsafe-math-optimizations as IEEE compliant  (which is
still under discussions) so I also think it is not the same problem.

> My understanding of the Fortran standard (7.1.8.3) is that reordering is
> allowed: 'a+b+c' can be computed as '(a+c)+b' (note 7.18), even if it is
> usually computed as '(a+b)+c', but "7.1.8.2 Integrity of parentheses" forbids
> to compute '(a+f)-f' as 'a'.

GCC has all or nothing policy for applying reordering optimization.
It currently does not have the ability to obey parenthesis in only parts
of the program as permitted in Fortran.  This is a separate problem I am
looking at.  For example; in programs like glibc that contains parts which
could benefit from re-ordering this flag can not be used as reordering
the rounding expression  (a+TWO52)-TWO52 --> a will result an error.

As for this bug - I will try to update -funsafe-math-optimizations flag
according to your suggestion in (4).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32172


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]