Global.c/multiple set insns tweak (fixed)

Jan Hubicka hubicka@atrey.karlin.mff.cuni.cz
Mon Jan 10 06:44:00 GMT 2000


Hi
I've just found bug in this patch (Oops).
The loop boundaries was incorrect (for some purpose it wors
in reversed order and that confused me). Here is correct one:

San Jan  9 05:03:20 CET 2000  Jan Hubicka  <jh@suse.cz>

	* global.c (global_conflicts): Mark conflict only for real output
	operands in multiple set insns.

Index: egcs/gcc/global.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/global.c,v
retrieving revision 1.52
diff -c -3 -p -r1.52 global.c
*** global.c	1999/12/20 12:13:01	1.52
--- global.c	2000/01/10 12:27:44
*************** Boston, MA 02111-1307, USA.  */
*** 34,39 ****
--- 34,40 ----
  #include "reload.h"
  #include "output.h"
  #include "toplev.h"
+ #include "recog.h"
  
  /* This pass of the compiler performs global register allocation.
     It assigns hard register numbers to all the pseudo registers
*************** global_conflicts ()
*** 782,806 ****
  		 register as an unused output we could set the hard register
  		 before the output reload insn.  */
  	      if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
! 		for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
! 		  if (REG_NOTE_KIND (link) == REG_DEAD)
! 		    {
! 		      int used_in_output = 0;
! 		      int i;
! 		      rtx reg = XEXP (link, 0);
! 
! 		      for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
! 			{
! 			  rtx set = XVECEXP (PATTERN (insn), 0, i);
! 			  if (GET_CODE (set) == SET
! 			      && GET_CODE (SET_DEST (set)) != REG
! 			      && !rtx_equal_p (reg, SET_DEST (set))
! 			      && reg_overlap_mentioned_p (reg, SET_DEST (set)))
! 			    used_in_output = 1;
! 			}
! 		      if (used_in_output)
! 			mark_reg_conflicts (reg);
! 		    }
  
  	      /* Mark any registers set in INSN and then never used.  */
  
--- 783,812 ----
  		 register as an unused output we could set the hard register
  		 before the output reload insn.  */
  	      if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
! 		{
! 		  extract_insn (insn);
! 		  for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
! 		    if (REG_NOTE_KIND (link) == REG_DEAD)
! 		      {
! 			int used_in_output = 0;
! 			int i;
! 			rtx reg = XEXP (link, 0);
! 
! 			for (i = recog_data.n_operands - 1; i >= 0; i--)
! 			  {
! 			    rtx op = recog_data.operand[i];
! 			    if (recog_data.operand_type[i] != OP_IN
! 				&& GET_CODE (op) != REG
! 				&& (GET_CODE (op) != SUBREG
! 				    || GET_CODE (SUBREG_REG (op)) != REG)
! 				&& !rtx_equal_p (reg, op)
! 				&& reg_overlap_mentioned_p (reg, op))
! 			      used_in_output = 1;
! 			  }
! 			if (used_in_output)
! 			  mark_reg_conflicts (reg);
! 		      }
! 		}
  
  	      /* Mark any registers set in INSN and then never used.  */
  


More information about the Gcc-patches mailing list