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: my EGCS status (really Fortran patches)


I was looking at this patch.

I see that you have installed the first hunk, but the second hunk is still
missing.  The second hunk is accidentally losing a SAVE_EXPR which needs
to be fixed before we could install it.

*** egcs-970929/gcc/fold-const.c.orig   Fri Oct  3 10:07:37 1997
--- egcs-970929/gcc/fold-const.c        Sat Oct  4 13:18:29 1997
*************** fold (expr)
*** 4611,4619 ****
         operation, EXACT_DIV_EXPR.

!        Note that only CEIL_DIV_EXPR is rewritten now, only because the
!        others seem to be faster in some cases.  This is probably just
!        due to more work being done to optimize others in expmed.c  
than on
!        EXACT_DIV_EXPR.  */
!       if (code == CEIL_DIV_EXPR
          && multiple_of_p (type, arg0, arg1))
        return fold (build (EXACT_DIV_EXPR, type, arg0, arg1));
--- 4611,4619 ----
         operation, EXACT_DIV_EXPR.

!        Note that only CEIL_DIV_EXPR and FLOOR_DIV_EXPR are  
rewritten now,
!          only because the others seem to be faster in some cases.
!          This is probably just due to more work being done to optimize
!          others in expmed.c than on EXACT_DIV_EXPR.  */
!       if ((code == CEIL_DIV_EXPR || code == FLOOR_DIV_EXPR)
          && multiple_of_p (type, arg0, arg1))
        return fold (build (EXACT_DIV_EXPR, type, arg0, arg1));
*************** fold (expr)
*** 4657,4660 ****
--- 4657,4680 ----
          STRIP_NOPS (xarg0);

+           if (TREE_CODE (xarg0) == MULT_EXPR
+               && multiple_of_p (type, TREE_OPERAND (xarg0, 0), arg1))
+             {
+               return fold (build (MULT_EXPR, type,
+                                   fold (build (EXACT_DIV_EXPR, type,
+                                                TREE_OPERAND (xarg0, 0),
+                                                arg1)),
+                                   TREE_OPERAND (xarg0, 1)));
+             }
+
+           if (TREE_CODE (xarg0) == MULT_EXPR
+               && multiple_of_p (Ttype, REE_OPERAND (xarg0, 1), arg1))
+             {
+               return fold (build (MULT_EXPR, type,
+                                   fold (build (EXACT_DIV_EXPR, type,
+                                                TREE_OPERAND (xarg0, 1),
+                                                arg1)),
+                                   TREE_OPERAND (xarg0, 0)));
+             }
+
          if (TREE_CODE (xarg0) == PLUS_EXPR
              && TREE_CODE (TREE_OPERAND (xarg0, 1)) == INTEGER_CST)



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