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]

[patch] for PR 15463


Hello,

one more place in loop-iv.c where we need to use trunc_int_for_mode (in
addition to those already covered in the patch for PR 15274).

Bootstrapped & regtested on i686.

Zdenek

	* loop-iv.c (iv_number_of_iterations):  Use trunc_int_for_mode on
	result of inverse.

Index: loop-iv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-iv.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 loop-iv.c
*** loop-iv.c	18 Mar 2004 16:42:31 -0000	2.7
--- loop-iv.c	15 May 2004 21:10:59 -0000
*************** iv_number_of_iterations (struct loop *lo
*** 1873,1879 ****
    rtx assumption;
    enum rtx_code cond;
    enum machine_mode mode, comp_mode;
!   rtx mmin, mmax;
    unsigned HOST_WIDEST_INT s, size, d;
    HOST_WIDEST_INT up, down, inc;
    int was_sharp = false;
--- 1873,1879 ----
    rtx assumption;
    enum rtx_code cond;
    enum machine_mode mode, comp_mode;
!   rtx mmin, mmax, inv;
    unsigned HOST_WIDEST_INT s, size, d;
    HOST_WIDEST_INT up, down, inc;
    int was_sharp = false;
*************** iv_number_of_iterations (struct loop *lo
*** 2186,2193 ****
        desc->infinite = alloc_EXPR_LIST (0, assumption, desc->infinite);
  
        tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d));
!       tmp = simplify_gen_binary (MULT, mode,
! 				 tmp, GEN_INT (inverse (s, size)));
        desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound);
      }
    else
--- 2186,2194 ----
        desc->infinite = alloc_EXPR_LIST (0, assumption, desc->infinite);
  
        tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d));
!       inv = inverse (s, size);
!       inv = trunc_int_for_mode (inv, mode);
!       tmp = simplify_gen_binary (MULT, mode, tmp, GEN_INT (mode));
        desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound);
      }
    else


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