On Thu, Mar 18, 2010 at 04:34:56PM +0100, Vincent Lefevre wrote: > On 2010-03-18 15:32:04 +0100, Michael Matz wrote: > > But unfortunately you are right, this expansion can only be done for > > -fno-signed-zeros. (FWIW the general expandsion of pow(x,N/2) where > > N!=1 is already guarded by unsafe_math, but for N==1 we do it > > unconditionally). > > If GCC is able to track range of values, the transformation could > be allowed when it can be proved that the value -0 is not possible > (e.g. when x > 0).
That would be useful, and other language implementations do similar things. GCC's VRP (value range propagation pass) does not handle floating-point values at the moment, though. -Nathan