[RFC] Fix PR28684

Richard Guenther rguenther@suse.de
Mon Nov 13 15:01:00 GMT 2006


On Mon, 13 Nov 2006, Revital1 Eres wrote:

> 
> Hello,
> 
> Regarding PR28684 - we were re-thinking of the current definition of the
> flags
> (-fassociative\reciprocal-math) and decided that instead of thinking of
> those flags in terms of arithmetic laws we refer to their semantics.
> Thus -fassociative-math will be defined as follows:
> 
> -fassociative-math:
> Allow optimization for floating-point arithmetic which may change the
> result of the operation due to rounding.
> NOTE: may reorder or strength reduce floating-point comparisons as
> well, and so may not be used when ordered comparisons are required.
> For example x + x + x can be transformed to 3 * x.
> 
> Because reciprocal transformations involves division
> it was separated from -fassociative-math and defined as follows:
> 
> -freciprocal-math:
> Same as -fassociative-math for expressions which include division.
> For example x / y can be replaced with x * (1/y)
> which is useful if (1/y) is subject to common subexpression elimination.
> 
> Attached is the patch (before testing).
> 
> I would like to thanks Richard Guenther for his help.
> 
> Comments are welcome.
> Revital
> 
> (See attached file: patch_associative)

The patch looks good (I cannot approve it though).  Can you add to the
-fassociative-math that it also may change behavior with signed zeros?
Even with the fix from Roger a useful definition of associative-math
should not honor them.

Richard.

--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs



More information about the Gcc-patches mailing list