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]

loop.c bugfix



This keeps the compiler from aborting if the target does not have a 2 operand
instruction to increment/decrement a register value.


Sat Nov 21 22:12:09 1998  Jeffrey A Law  (law@cygnus.com)

        * loop.c (check_dbra_loop): Avoid using gen_add2_insn.

*************** check_dbra_loop (loop_end, insn_count, l
*** 7050,7059 ****
  		   better to have a testcase first.  */
  		return 0;
  
! 	      /* Add insn to decrement register, and delete insn
! 		 that incremented the register.  */
! 	      p = emit_insn_before (gen_add2_insn (reg, new_add_val),
! 				    bl->biv->insn);
  	      delete_insn (bl->biv->insn);
  		      
  	      /* Update biv info to reflect its new status.  */
--- 7061,7074 ----
  		   better to have a testcase first.  */
  		return 0;
  
! 	      /* We may not have a single insn which can increment a reg, so
! 		 create a sequence to hold all the insns from expand_inc.  */
! 	      start_sequence ();
! 	      expand_inc (reg, new_add_val);
!               tem = gen_sequence ();
!               end_sequence ();
! 
! 	      p = emit_insn_before (tem, bl->biv->insn);
  	      delete_insn (bl->biv->insn);
  		      
  	      /* Update biv info to reflect its new status.  */


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