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]

unroll.c patch for IA-64 abort on XFree86


This fixes an ia64-linux -O2 abort when compiling xaaPCache.c which I think
is from XFree86.  This stems from Richard Henderson's earlier change to
support givs which are DImode extended from SImode bivs.

The problem happens in final_giv_value when we pass a mixture of SImode
and DImode values to emit_iv_add_mult, which eventually triggers an abort
because of the mode mismatch.  The fix is simply that we need to extend
increment in case it is not a constant, just like we already extend the biv
initial value.
	
2000-09-18  Jim Wilson  <wilson@cygnus.com>

	* unroll.c (final_giv_value): Pass increment through
	extend_value_for_giv before passing it to emit_iv_add_mult.

Index: unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
retrieving revision 1.108
diff -p -r1.108 unroll.c
*** unroll.c	2000/09/12 14:43:25	1.108
--- unroll.c	2000/09/18 22:45:58
*************** final_giv_value (loop, v)
*** 3349,3355 ****
  	  /* Put the final biv value in tem.  */
  	  tem = gen_reg_rtx (v->mode);
  	  record_base_value (REGNO (tem), bl->biv->add_val, 0);
! 	  emit_iv_add_mult (increment, GEN_INT (n_iterations),
  			    extend_value_for_giv (v, bl->initial_value),
  			    tem, insert_before);
  
--- 3349,3356 ----
  	  /* Put the final biv value in tem.  */
  	  tem = gen_reg_rtx (v->mode);
  	  record_base_value (REGNO (tem), bl->biv->add_val, 0);
! 	  emit_iv_add_mult (extend_value_for_giv (v, increment),
! 			    GEN_INT (n_iterations),
  			    extend_value_for_giv (v, bl->initial_value),
  			    tem, insert_before);
  

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