public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [reload-v2] Fix bootstrap problems after last merge
@ 2010-06-10  6:45 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2010-06-10  6:45 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]


This fixes various minor problems bootstrapping after this week's merge 
from the trunk to the reload-v2 branch.  One issue was 
ira_bad_reload_regno was integrated onto the trunk and we had a 
duplicate definition on the branch.  With Bernd's recent patch we're 
seeing some allocnos with NO_REGS appearing more often, which can lead 
to problems because there is no cost_vector_pool created for NO_REGS.  
Finally we don't want to wipe the reg_equiv_memory_loc state when 
ira-reload calls back into ira_costs.

The problems with allocnos preferring NO_REGS is something that I'm 
still looking at -- for the case I'm working on we really just want a 
GENERAL_REG, but are punting to NO_REGS for reasons unknown.



[-- Attachment #2: PP --]
[-- Type: text/plain, Size: 3356 bytes --]

Index: ira-build.c
===================================================================
*** ira-build.c	(revision 160389)
--- ira-build.c	(working copy)
*************** initiate_cost_vectors (void)
*** 1371,1376 ****
--- 1371,1381 ----
  			     * ira_class_hard_regs_num[cover_class],
  			     100);
      }
+   cost_vector_pool[NO_REGS]
+     = create_alloc_pool ("cost vectors",
+ 			  sizeof (int)
+ 			  * ira_class_hard_regs_num[NO_REGS],
+ 			  100);
  }
  
  /* Allocate and return a cost vector VEC for COVER_CLASS.  */
Index: ira-reload.c
===================================================================
*** ira-reload.c	(revision 160389)
--- ira-reload.c	(working copy)
*************** ira_reload (void)
*** 1160,1202 ****
        df_analyze ();
      }
  }
- 
- /* Return nonzero if REGNO is a particularly bad choice for reloading X.  */
- static int
- ira_bad_reload_regno_1 (int regno, rtx x)
- {
-   int x_regno;
-   ira_allocno_t a;
-   enum reg_class pref;
- 
-   /* We only deal with pseudo regs.  */
-   if (! x || GET_CODE (x) != REG)
-     return 0;
- 
-   x_regno = REGNO (x);
-   if (x_regno < FIRST_PSEUDO_REGISTER)
-     return 0;
- 
-   /* If the pseudo prefers REGNO explicitly, then do not consider
-      REGNO a bad spill choice.  */
-   pref = reg_preferred_class (x_regno);
-   if (reg_class_size[pref] == 1)
-     return !TEST_HARD_REG_BIT (reg_class_contents[pref], regno);
- 
-   /* If the pseudo conflicts with REGNO, then we consider REGNO a
-      poor choice for a reload regno.  */
-   a = ira_regno_allocno_map[x_regno];
-   if (TEST_HARD_REG_BIT (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), regno))
-     return 1;
- 
-   return 0;
- }
- 
- /* Return nonzero if REGNO is a particularly bad choice for reloading
-    IN or OUT.  */
- int
- ira_bad_reload_regno (int regno, rtx in, rtx out)
- {
-   return (ira_bad_reload_regno_1 (regno, in)
- 	  || ira_bad_reload_regno_1 (regno, out));
- }
--- 1160,1162 ----
Index: ira.h
===================================================================
*** ira.h	(revision 160389)
--- ira.h	(working copy)
*************** extern rtx ira_reuse_stack_slot (int, un
*** 87,92 ****
  extern void ira_mark_new_stack_slot (rtx, int, unsigned int);
  extern bool ira_better_spill_reload_regno_p (int *, int *, rtx, rtx, rtx);
  extern bool ira_bad_reload_regno (int, rtx, rtx);
- 
- extern int ira_bad_reload_regno (int, rtx, rtx);
  extern void ira_adjust_equiv_reg_cost (unsigned, int);
--- 87,90 ----
Index: ira-costs.c
===================================================================
*** ira-costs.c	(revision 160389)
--- ira-costs.c	(working copy)
*************** ira_costs (int min_regno)
*** 1727,1733 ****
    init_costs ();
    total_allocno_costs = (struct costs *) ira_allocate (max_struct_costs_size
  						       * ira_allocnos_num);
!   calculate_elim_costs_all_insns ();
    find_costs_and_classes (ira_dump_file, min_regno);
    setup_allocno_cover_class_and_costs (min_regno);
    finish_costs ();
--- 1727,1734 ----
    init_costs ();
    total_allocno_costs = (struct costs *) ira_allocate (max_struct_costs_size
  						       * ira_allocnos_num);
!   if (min_regno == FIRST_PSEUDO_REGISTER)
!     calculate_elim_costs_all_insns ();
    find_costs_and_classes (ira_dump_file, min_regno);
    setup_allocno_cover_class_and_costs (min_regno);
    finish_costs ();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-10  3:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-10  6:45 [reload-v2] Fix bootstrap problems after last merge Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).