This is the mail archive of the
mailing list for the GCC project.
Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.
- From: Bradley Lucier <lucier at math dot purdue dot edu>
- To: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: Bradley Lucier <lucier at math dot purdue dot edu>, Roger Sayle <roger at eyesopen dot com>, fjahanian at apple dot com
- Date: Thu, 25 Mar 2004 21:41:13 -0500
- Subject: Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.
My vote, at least right now, would be to add -fassociative-math to
mean that gcc is permitted to reassociate math expressions at will,
regardless of the presence of parentheses. And -ffast-math should
imply -fassociative-math. That is, with -ffast-math, (a+b)+c may be
evaluated as a+(b+c).
I would like to second that suggestion, not because -fassociative-math
is a particularly bad option for many algorithms, but that it's a
particularly *benign* option for many programs. For example, the usual
error analysis for numerical linear algebra programs does not depend on
the order that the additions are performed in; and Colin Percival's
beautiful analysis of the FFT using floating point arithmetic is not
invalidated by re-association (while it depends critically on the
accuracy of the sin/cos computations used).
So, now, I'd like to be able to use this flag in places where I cannot
otherwise use -funsafe-math-optimizations. And in the future, will
there not be pragmas that one can use to designate that certain blocks
of code will be compiled with certain floating-point properties? If
so, this is a great property to put around a block of code where
re-association doesn't matter.