[new-regalloc-branch] libffi/ffitest.c bugfix

Denis Chertykov denisc@overta.ru
Sun Apr 7 05:10:00 GMT 2002


Excuse me, I can't make full bootstrap is again only C,C++.
I will make full bootstrap for next commit.

Sun Apr  7 15:58:46 2002  Denis Chertykov  <denisc@overta.ru>

	* ra.c (emit_colors): Choose mode from insn not from
	PSEUDO_REGNO_MODE.
	(dump_web_insns): New debug function.
	* pre-reload.c (emit_pre_reload_insns): Change generation of
	reload register.
	(push_pre_reload): More accurate work with the general reload mode.
	(collect_insn_info): Likewise.

Index: ra.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/ra.c,v
retrieving revision 1.1.2.50
diff -c -3 -p -r1.1.2.50 ra.c
*** ra.c	21 Mar 2002 19:52:17 -0000	1.1.2.50
--- ra.c	7 Apr 2002 11:29:37 -0000
*************** static void splits_init PARAMS ((void));
*** 477,482 ****
--- 477,484 ----
  static void setup_renumber PARAMS ((int));
  static void check_df PARAMS ((struct df *));
  static void remove_suspicious_death_notes PARAMS ((void));
+ static void dump_web_conflicts PARAMS ((struct web *));
+ static void dump_web_insns PARAMS ((struct web*));
  void reg_alloc PARAMS ((void));
  
  /* XXX use Daniels compressed bitmaps here.  */
*************** emit_colors (df)
*** 7874,7880 ****
  	continue;
        if (web->reg_rtx || web->regno < FIRST_PSEUDO_REGISTER)
  	abort ();
!       web->reg_rtx = gen_reg_rtx (PSEUDO_REGNO_MODE (web->regno));
        /* Remember the different parts directly coalesced to a hardreg.  */
        if (web->type == COALESCED)
  	bitmap_set_bit (regnos_coalesced_to_hardregs, REGNO (web->reg_rtx));
--- 7876,7890 ----
  	continue;
        if (web->reg_rtx || web->regno < FIRST_PSEUDO_REGISTER)
  	abort ();
! 
!       /* Special case for i386 'fix_truncdi_nomemory' insn.
! 	 We must choose mode from insns not from PSEUDO_REGNO_MODE.
! 	 Actual only for clobbered register.  */
!       if (web->num_uses == 0 && web->num_defs == 1)
! 	web->reg_rtx = gen_reg_rtx (GET_MODE (DF_REF_REG (web->defs[0])));
!       else
! 	web->reg_rtx = gen_reg_rtx (PSEUDO_REGNO_MODE (web->regno));
!       
        /* Remember the different parts directly coalesced to a hardreg.  */
        if (web->type == COALESCED)
  	bitmap_set_bit (regnos_coalesced_to_hardregs, REGNO (web->reg_rtx));
*************** reg_alloc (void)
*** 9434,9440 ****
  	     free our own version.  reg_renumber[] will again be destroyed
  	     later.  We right now need it in dump_constraints() for
  	     constrain_operands(1) whose subproc sometimes reference
! 	     it (because we are cehcking strictly, i.e. as if
  	     after reload).  */
  	  setup_renumber (0);
  	  delete_moves ();
--- 9444,9450 ----
  	     free our own version.  reg_renumber[] will again be destroyed
  	     later.  We right now need it in dump_constraints() for
  	     constrain_operands(1) whose subproc sometimes reference
! 	     it (because we are checking strictly, i.e. as if
  	     after reload).  */
  	  setup_renumber (0);
  	  delete_moves ();
*************** web_conflicts_p (web1, web2)
*** 9543,9550 ****
      
    return hard_regs_intersect_p (&web1->usable_regs, &web2->usable_regs);
  }
  
! static void dump_web_conflicts PARAMS ((struct web *));
  
  /* Dump conflicts for web WEB.  */
  static void
--- 9553,9585 ----
      
    return hard_regs_intersect_p (&web1->usable_regs, &web2->usable_regs);
  }
+ 
+ /* Dump all insns from one web.  */
+ static void
+ dump_web_insns (web)
+      struct web* web;
+ {
+   unsigned int i;
+   
+   debug_msg (DUMP_EVER, "Web: %i(%i)+%i class: %s freedom: %i degree %i\n",
+ 	     web->id, web->regno, web->add_hardregs,
+ 	     reg_class_names[web->regclass],
+ 	     web->num_freedom, web->num_conflicts);
+   debug_msg (DUMP_EVER, "   def insns:");
+   
+   for (i = 0; i < web->num_defs; ++i)
+     {
+       debug_msg (DUMP_EVER, " %d ", INSN_UID (web->defs[i]->insn));
+     }
  
!   debug_msg (DUMP_EVER, "\n   use insns:");
!   for (i = 0; i < web->num_uses; ++i)
!     {
!       debug_msg (DUMP_EVER, " %d ", INSN_UID (web->uses[i]->insn));
!     }
!   debug_msg (DUMP_EVER, "\n");
! }
! 
  
  /* Dump conflicts for web WEB.  */
  static void
Index: pre-reload.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/pre-reload.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 pre-reload.c
*** pre-reload.c	6 Apr 2002 08:49:40 -0000	1.1.2.3
--- pre-reload.c	7 Apr 2002 11:30:05 -0000
*************** emit_pre_reload_insns (insn)
*** 787,809 ****
  
        in = rld[r].in;
        out = rld[r].out;
!       if (!in)
! 	rld[r].reg_rtx = gen_reg_rtx (GET_MODE (out));
!       else if (!out)
! 	{
! 	  rld[r].reg_rtx = gen_reg_rtx (rld[r].mode);
! 	}
!       else if (GET_MODE (in) != GET_MODE (out)
! 	       && INTEGRAL_MODE_P (GET_MODE (in))
! 	       && INTEGRAL_MODE_P (GET_MODE (out)))
! 	{
! 	  if (GET_MODE_SIZE (GET_MODE (in)) > GET_MODE_SIZE (GET_MODE (out)))
! 	    rld[r].reg_rtx = gen_reg_rtx (GET_MODE (in));
! 	  else
! 	    rld[r].reg_rtx = gen_reg_rtx (GET_MODE (out));
! 	}
!       else
! 	rld[r].reg_rtx = gen_reg_rtx (GET_MODE (out));
      }
  
    for (j = 0; j < reload_n_operands; j++)
--- 787,793 ----
  
        in = rld[r].in;
        out = rld[r].out;
!       rld[r].reg_rtx = gen_reg_rtx (rld[r].mode);
      }
  
    for (j = 0; j < reload_n_operands; j++)
*************** push_pre_reload (in, out, inloc, outloc,
*** 1381,1386 ****
--- 1365,1371 ----
  	  && GET_MODE_SIZE (GET_MODE (out)) > GET_MODE_SIZE (outmode))
  	abort ();
  #endif
+       general_mode = outmode;
        outmode = GET_MODE (out);
      }
  
*************** collect_insn_info (insn, def_refs, use_r
*** 3295,3304 ****
  	{
  	  if (rld[i].mode == VOIDmode)
  	    {
! 	      rld[i].mode = (rld[i].out
! 			     && (GET_MODE_SIZE (rld[i].outmode)
! 				 > GET_MODE_SIZE (rld[i].inmode)))
! 		? rld[i].outmode : rld[i].inmode;
  	    }
  	}
        return;
--- 3280,3293 ----
  	{
  	  if (rld[i].mode == VOIDmode)
  	    {
! 	      if (!rld[i].out)
! 		rld[i].mode = rld[i].inmode;
! 	      else if (!rld[i].in)
! 		rld[i].mode = rld[i].outmode;
! 	      else
! 		rld[i].mode = (GET_MODE_SIZE (rld[i].outmode)
! 			       > GET_MODE_SIZE (rld[i].inmode)
! 			       ? rld[i].outmode : rld[i].inmode);
  	    }
  	}
        return;




More information about the Gcc-patches mailing list