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]

[new-ra] gnatlib_and_tools


Hi,

on amd64 it didn't build the 32bit libiberty (I usually used
--disable-multilib).  Fixing that broke gnatlib again (the joy of fast but
wrong methods of avoiding work).  Fixing that broke gnatlib elsewhere.
Fixing that just costed me some hair.  It now bootstraps all langs on x86
and amd64, plus gnatlib_and_tools, and with multilibs (only tested with
MICHAEL but not DENIS defined).


Ciao,
Michael.
-- 
2003-10-29  Michael Matz  <matz@suse.de>

        * ra-build.c (select_regclass): Extend usable_regs for uninitialized
        webs.

2003-10-28  Michael Matz  <matz@suse.de>

        * ra.c (toplevel, one_pass): Use have_splits_p instead of
        any_splits_found.
        * ra-rewrite.c (have_splits_p): New.
        (any_splits_found): Delete.
        (actual_spill, init_split_costs, insert_splits): Use it.

2003-10-28  Michael Matz  <matz@suse.de>

        * ra-build.c (parts_to_webs_1): Initialize web members.

Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.1.2.24
diff -u -p -r1.1.2.24 ra-build.c
--- ra-build.c	27 Oct 2003 16:56:43 -0000	1.1.2.24
+++ ra-build.c	28 Oct 2003 15:27:25 -0000
@@ -2008,6 +2008,16 @@ parts_to_webs_1 (struct df *df, struct w
 	    abort ();
 	  refs[r] = ref;
 	  def2web[i] = subweb;
+	  /* Remember to also update the flag depending on this ref.  */
+	  if ((DF_REF_FLAGS (ref) & DF_REF_MODE_CHANGE) != 0
+	      && web->regno >= FIRST_PSEUDO_REGISTER)
+	    web->mode_changed = 1;
+	  if ((DF_REF_FLAGS (ref) & DF_REF_STRIPPED) != 0
+	      && web->regno >= FIRST_PSEUDO_REGISTER)
+	    web->subreg_stripped = 1;
+	  if (i >= def_id
+	      && TEST_BIT (live_over_abnormal, ref_id))
+	    web->live_over_abnormal = 1;
 	  continue;
 	}

Index: ra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra.c,v
retrieving revision 1.1.2.74
diff -u -p -r1.1.2.74 ra.c
--- ra.c	13 Oct 2003 13:02:27 -0000	1.1.2.74
+++ ra.c	28 Oct 2003 23:57:15 -0000
@@ -453,7 +453,7 @@ free_all_mem (struct df *df)
 static long ticks_build;
 static long ticks_rebuild;

-extern int any_splits_found;
+extern int have_splits_p (void);

 /* Perform one pass of allocation.  Returns nonzero, if some spill code
    was added, i.e. if the allocator needs to rerun.  */
@@ -489,7 +489,7 @@ one_pass (struct df *df, int rebuild)
       something_spilled = !!WEBS(SPILLED);

       /* Add spill code if necessary.  */
-      if (something_spilled || any_splits_found)
+      if (something_spilled || have_splits_p ())
 	something_spilled = actual_spill (1);

       /* Check all colored webs to detect ones colored by an_unusable_color.
Index: ra-rewrite.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-rewrite.c,v
retrieving revision 1.1.2.23
diff -u -p -r1.1.2.23 ra-rewrite.c
--- ra-rewrite.c	25 Oct 2003 07:03:02 -0000	1.1.2.23
+++ ra-rewrite.c	28 Oct 2003 23:57:15 -0000
@@ -2118,8 +2118,8 @@ subst_to_stack_p ()
    spill code.  This also sets up the structures for incrementally
    building the interference graph in the next pass.  */

+extern int have_splits_p (void);
 extern void insert_splits (bitmap);
-int any_splits_found;

 int
 actual_spill (int spill_p ATTRIBUTE_UNUSED)
@@ -2168,7 +2168,7 @@ actual_spill (int spill_p ATTRIBUTE_UNUS
   if (ra_pass > 1)
     {
       rebuildit = need_rebuild ();
-      rebuildit |= any_splits_found;
+      rebuildit |= have_splits_p ();
       detect_non_changed_webs ();
     }
   detect_web_parts_to_rebuild ();
@@ -3135,6 +3135,18 @@ reset_web_live_s (live, suplive, web)
     bitmap_clear_bit (suplive, web->id);
 }

+int
+have_splits_p (void)
+{
+  unsigned int i;
+  if (!flag_ra_split_webs)
+    return 0;
+  for (i = 0; i < num_webs - num_subwebs; i++)
+    if (split_around[i] && bitmap_first_set_bit (split_around[i]) >= 0)
+      return 1;
+  return 0;
+}
+
 extern int copy_insn_p PARAMS ((rtx, rtx *, rtx *));
 extern void init_split_costs PARAMS ((void));
 extern int find_splits PARAMS ((struct web *));
@@ -3162,7 +3174,6 @@ init_split_costs ()
   for (i = 0; i < (unsigned) last_basic_block + 2; i++)
     live_at_begin[i] = sbitmap_alloc (num_webs);
   live_at_begin += 2;
-  any_splits_found = 0;

   FOR_EACH_BB (bb)
     {
@@ -3520,7 +3531,6 @@ find_splits (web)
       web->color = newcol;
       remove_list (web->dlink, &WEBS(SPILLED));
       put_web (web, COLORED);
-      any_splits_found = 1;
       return 1;
     }
   else
@@ -3692,7 +3702,7 @@ insert_splits (new_deaths)
   basic_block bb;
   sbitmap live, need_load;
   bitmap suplive, split_those_1, lazy_store;
-  if (!any_splits_found)
+  if (!have_splits_p ())
     return;
   suplive = BITMAP_XMALLOC ();
   split_those_1 = BITMAP_XMALLOC ();
Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.1.2.24
diff -u -p -r1.1.2.24 ra-build.c
--- ra-build.c	27 Oct 2003 16:56:43 -0000	1.1.2.24
+++ ra-build.c	29 Oct 2003 02:44:22 -0000
@@ -3023,6 +3033,19 @@ select_regclass ()
 	 where, if it finally is allocated to GENERAL_REGS it needs two,
 	 if allocated to FLOAT_REGS only one hardreg.  XXX */
       AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
+
+      /* Don't limit usable regs for uninitialized webs too much.
+	 This could make us spill them (when usable_regs becomes empty
+	 if we also remove caller saved regs),
+	 which actually produces invalid code for rmw references (where we
+	 didn't connect both refs dues to the read part being
+	 uninitialized).  Don't just avoid removing caller saved regs
+         for such webs.  Such webs look like live everywhere to flow,
+         also live over calls.  If we choose a caller save reg then
+         caller-save.c will insert the necessary insns.  */
+      if (!web->num_defs)
+	IOR_HARD_REG_SET (web->usable_regs,
+			  reg_class_contents[(int) GENERAL_REGS]);
       if (web->crosses_call)
 	{
 	  unsigned int num_refs = web->num_uses + web->num_defs;


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