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] fix broken loop-doloop.c


Most of loop-doloop.c is wrapped by
#ifdef HAVE_doloop_end
<...>
#endif

so on my bootstraps/builds, it doesn't exercise the code. It was pointed out to me the restructuring broke this file on some targets. This should fix it by calling the refactored get_max_loop_iterations() function. cross compiled for rs6000 to verify compilation.

committed as revision 203324

Andrew
	* loop-doloop.c (doloop_modify, doloop_optimize): Use 
	get_max_loop_iterations.

Index: loop-doloop.c
===================================================================
*** loop-doloop.c	(revision 203285)
--- loop-doloop.c	(working copy)
*************** doloop_modify (struct loop *loop, struct
*** 460,466 ****
  
        /* Determine if the iteration counter will be non-negative.
  	 Note that the maximum value loaded is iterations_max - 1.  */
!       if (max_loop_iterations (loop, &iterations)
  	  && (iterations.ule (double_int_one.llshift
  			       (GET_MODE_PRECISION (mode) - 1,
  				GET_MODE_PRECISION (mode)))))
--- 460,466 ----
  
        /* Determine if the iteration counter will be non-negative.
  	 Note that the maximum value loaded is iterations_max - 1.  */
!       if (get_max_loop_iterations (loop, &iterations)
  	  && (iterations.ule (double_int_one.llshift
  			       (GET_MODE_PRECISION (mode) - 1,
  				GET_MODE_PRECISION (mode)))))
*************** doloop_modify (struct loop *loop, struct
*** 552,558 ****
      double_int iter;
      rtx iter_rtx;
  
!     if (!max_loop_iterations (loop, &iter)
  	|| !iter.fits_shwi ())
        iter_rtx = const0_rtx;
      else
--- 552,558 ----
      double_int iter;
      rtx iter_rtx;
  
!     if (!get_max_loop_iterations (loop, &iter)
  	|| !iter.fits_shwi ())
        iter_rtx = const0_rtx;
      else
*************** doloop_optimize (struct loop *loop)
*** 669,675 ****
  
    count = copy_rtx (desc->niter_expr);
    iterations = desc->const_iter ? desc->niter_expr : const0_rtx;
!   if (!max_loop_iterations (loop, &iter)
        || !iter.fits_shwi ())
      iterations_max = const0_rtx;
    else
--- 669,675 ----
  
    count = copy_rtx (desc->niter_expr);
    iterations = desc->const_iter ? desc->niter_expr : const0_rtx;
!   if (!get_max_loop_iterations (loop, &iter)
        || !iter.fits_shwi ())
      iterations_max = const0_rtx;
    else

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