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]

[3.4] PR 15761


Hello,

this patch fixes the PR by using gen_int_mode instead of gen_int.

OK if it passes testing?

Zdenek

	PR rtl-optimization/15761
	* cfgloopanal.c (count_strange_loop_iterations,
	count_loop_iterations): Use gen_int_mode instead
	of GEN_INT.

Index: cfgloopanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopanal.c,v
retrieving revision 1.18.4.1
diff -c -3 -p -r1.18.4.1 cfgloopanal.c
*** cfgloopanal.c	2 Mar 2004 01:12:03 -0000	1.18.4.1
--- cfgloopanal.c	7 Jun 2004 23:00:55 -0000
*************** count_strange_loop_iterations (rtx init,
*** 603,610 ****
      case LE:
      case LT:
        size = GET_MODE_BITSIZE (mode);
!       mode_min = GEN_INT (-((unsigned HOST_WIDEST_INT) 1 << (size - 1)));
!       mode_max = GEN_INT (((unsigned HOST_WIDEST_INT) 1 << (size - 1)) - 1);
  			      
        break;
  
--- 603,612 ----
      case LE:
      case LT:
        size = GET_MODE_BITSIZE (mode);
!       mode_min = gen_int_mode (-((unsigned HOST_WIDEST_INT) 1 << (size - 1)),
! 			       mode);
!       mode_max = gen_int_mode (((unsigned HOST_WIDEST_INT) 1 << (size - 1)) - 1,
! 			       mode);
  			      
        break;
  
*************** count_loop_iterations (struct loop_desc 
*** 869,878 ****
  	  d *= 2;
  	  size--;
  	}
!       bound = GEN_INT (((unsigned HOST_WIDEST_INT) 1 << (size - 1 ) << 1) - 1);
!       exp = simplify_gen_binary (UDIV, mode, exp, GEN_INT (d));
        exp = simplify_gen_binary (MULT, mode,
! 				 exp, GEN_INT (inverse (s, size)));
        exp = simplify_gen_binary (AND, mode, exp, bound);
        break;
  
--- 871,881 ----
  	  d *= 2;
  	  size--;
  	}
!       bound = gen_int_mode (((unsigned HOST_WIDEST_INT) 1 << (size - 1 ) << 1) - 1,
! 			    mode);
!       exp = simplify_gen_binary (UDIV, mode, exp, gen_int_mode (d, mode));
        exp = simplify_gen_binary (MULT, mode,
! 				 exp, gen_int_mode (inverse (s, size), mode));
        exp = simplify_gen_binary (AND, mode, exp, bound);
        break;
  


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