This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PING][PATCH] Fix PR 28684


On Sun, 5 Nov 2006, Richard Guenther wrote:

> On Sun, 5 Nov 2006, Revital1 Eres wrote:
> 
> > Hello,
> > 
> > I do not have write permission to commit this patch.  I appreciate it
> > if you could direct me to someone who can do that for me.
> 
> In the pathes the below mail points to documentation for the new
> flags is still missing as noted by me earlier.

I also note that for example with the hunk

Index: combine.c
===================================================================
--- combine.c	(revision 117280)
+++ combine.c	(working copy)
@@ -4587,7 +4587,7 @@
 	}
 
       /* Try simplify a*(b/c) as (a*b)/c.  */
-      if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations
+      if (FLOAT_MODE_P (mode) && flag_reciprocal_math
 	  && GET_CODE (XEXP (x, 0)) == DIV)
 	{
 	  rtx tem = simplify_binary_operation (MULT, mode,

the transformation is a re-association.  Or both a re-association
and a reciprocal transformation but not only the latter.

Likewise here:

       /* Convert C1/(X*C2) into (C1/C2)/X.  */
-      if (flag_unsafe_math_optimizations
+      if (flag_reciprocal_math
 	  && TREE_CODE (arg1) == MULT_EXPR
 	  && TREE_CODE (arg0) == REAL_CST
 	  && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST)

and in most other cases.  Or do we want flag_reciprocal_math
to imply flag_associative_math?

In some of the cases you do

@@ -1107,7 +1107,7 @@
 
     case MINUS_EXPR:
       /* - (A - B) -> B - A  */
-      if ((! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)
+      if ((! FLOAT_TYPE_P (type) || flag_associative_math)
 	  && reorder_operands_p (TREE_OPERAND (t, 0), TREE_OPERAND (t, 
1)))
 	return fold_build2 (MINUS_EXPR, type,
 			    TREE_OPERAND (t, 1), TREE_OPERAND (t, 0));

or

@@ -971,7 +971,7 @@
 
     case MINUS_EXPR:
       /* We can't turn -(A-B) into B-A when we honor signed zeros.  */
-      return (! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)
+      return (! FLOAT_TYPE_P (type) || flag_associative_math)
 	     && reorder_operands_p (TREE_OPERAND (t, 0),
 				    TREE_OPERAND (t, 1));
 
where the comment already suggests this should read || !HONOR_SIGNED_ZEROS 
(TYPE_MODE (type)).  There are machines without signed zeros out there
which will benefit from this even without flag_associative_math.

Richard.

> 
> > 
> > Thanks again,
> > Revital
> > 
> > Roger Sayle <roger@eyesopen.com> wrote on 29/10/2006 16:13:34:
> > 
> > >
> > > On Sun, 29 Oct 2006, Revital1 Eres wrote:
> > > > http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00110.html
> > >
> > > These two patches are OK for mainline.  Thanks.
> > >
> > > Thanks also to Clint Whaley for clearly describing why this command
> > > line option is a useful categorizaton in PR middle-end/28684.
> > >
> > > Roger
> > > --
> > >
> > 
> > 
> 
> --
> Richard Guenther <rguenther@suse.de>
> Novell / SUSE Labs
> 

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


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