On 5/26/05, Scott Robert Ladd <[EMAIL PROTECTED]> wrote: > Allan Sandfeld Jensen wrote: > >>Yes. I still don't understand why gcc doesn't do -ffast-math by > >>default like all other compilers. > > Vincent Lefevre wrote: > > No! And I really don't think that other compilers do that. > > It would be very bad, would not conform to the C standard[*] > > and would make lots of codes fail. > > Perhaps what needs to be changed is the definition of -ffast-math > itself. Some people (myself included) view it from the standpoint of > using the full capabilities of our processors' hardware intrinsics; > however, -ffast-math *also* implies the rearrangement of code that > violates Standard behavior. Thus it does two things that perhaps should > not be combined. > > To be more pointed, it is -funsafe-math-optimizations (implied by > -ffast-math) that is in need of adjustment. > > May I be so bold as to suggest that -funsafe-math-optimizations be > reduced in scope to perform exactly what it's name implies: > transformations that may slightly alter the meanding of code. Then move > the use of hardware intrinsics to a new -fhardware-math switch.
I think the other options implied by -ffast-math apart from -funsafe-math-optimizations should (and do?) enable the use of hardware intrinsics already. It's only that some of the optimzations guarded by -funsafe-math-optimizations could be applied in general. A good start may be to enumerate the transformations done on a Wiki page and list the flags it is guarded with. Richard.