This is the mail archive of the gcc@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]

Re: Optimization Question





  >        a=b*(c+d)  I
  >
  > versus
  >        a=b*c+b*d  II
  >
  > The current snapshot doesn't recognize the equivalence and simply
  > generates two fmuls and and a faddp for case II (only one fmuls
  >for
  > I).  Is this something that could be build into the optimization?

gcc does not currently have this capability.

Please, no!
Floating point arithmetic does not obey  the associative law.
This transformation should never be allowed, in any programming language.

Further, the transformation cannot be regarded as an "optimization"
because it can change the value of an expression.  We have worked hard,
I thought, to prevent any optimizations from changing the value of
an expression.




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