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]

[vta] minimal IRA tweaking to get past most ICEs


The 2008-10-10 merge brought in IRA, which didn't expect to have to
deal with debug insns, particularly to *not* paying attention to them
while making decisions.

I still haven't found all situations in which debug insns affect IRA
(I'm part-way fixing just one such bug, not included in this patch),
but this one gets us successful compilation, at the very least.  I
haven't checked whether IRA still updates debug insns to reflect its
decisions, that's something for a later day (guality checks, I guess).

I'm installing this for now.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* ira-build.c (create_bb_allocnos): Disregard debug insns.
	* ira-conflicts.c (add_copies): Likewise.
	* ira-costs.c (scan_one_insn, process_bb_node_for_hard_reg_moves):
	Likewise.
	* ira-lives.c (process_bb_node_lives): Likewise.

Index: gcc/ira-build.c
===================================================================
--- gcc/ira-build.c.orig	2008-10-10 09:31:05.000000000 -0300
+++ gcc/ira-build.c	2008-10-13 15:43:51.000000000 -0300
@@ -1378,7 +1378,7 @@ create_bb_allocnos (ira_loop_tree_node_t
   curr_bb = bb = bb_node->bb;
   ira_assert (bb != NULL);
   FOR_BB_INSNS_REVERSE (bb, insn)
-    if (INSN_P (insn))
+    if (INSN_P (insn) && !DEBUG_INSN_P (insn))
       create_insn_allocnos (PATTERN (insn), false);
   /* It might be a allocno living through from one subloop to
      another.  */
Index: gcc/ira-conflicts.c
===================================================================
--- gcc/ira-conflicts.c.orig	2008-10-10 09:31:04.000000000 -0300
+++ gcc/ira-conflicts.c	2008-10-13 15:44:05.000000000 -0300
@@ -487,7 +487,7 @@ add_copies (ira_loop_tree_node_t loop_tr
   if (bb == NULL)
     return;
   FOR_BB_INSNS (bb, insn)
-    if (INSN_P (insn))
+    if (INSN_P (insn) && !DEBUG_INSN_P (insn))
       add_insn_allocno_copies (insn);
 }
 
Index: gcc/ira-costs.c
===================================================================
--- gcc/ira-costs.c.orig	2008-10-10 09:31:06.000000000 -0300
+++ gcc/ira-costs.c	2008-10-13 15:44:42.000000000 -0300
@@ -971,7 +971,7 @@ scan_one_insn (rtx insn)
   rtx set, note;
   int i, k;
 
-  if (!INSN_P (insn))
+  if (!INSN_P (insn) || DEBUG_INSN_P (insn))
     return insn;
 
   pat_code = GET_CODE (PATTERN (insn));
@@ -1338,7 +1338,7 @@ process_bb_node_for_hard_reg_moves (ira_
     freq = 1;
   FOR_BB_INSNS (bb, insn)
     {
-      if (! INSN_P (insn))
+      if (! INSN_P (insn) || DEBUG_INSN_P (insn))
 	continue;
       set = single_set (insn);
       if (set == NULL_RTX)
Index: gcc/ira-lives.c
===================================================================
--- gcc/ira-lives.c.orig	2008-10-10 09:31:05.000000000 -0300
+++ gcc/ira-lives.c	2008-10-13 15:41:22.000000000 -0300
@@ -705,7 +705,7 @@ process_bb_node_lives (ira_loop_tree_nod
 	  struct df_ref **def_rec, **use_rec;
 	  bool call_p;
 	  
-	  if (! INSN_P (insn))
+	  if (! INSN_P (insn) || DEBUG_INSN_P (insn))
 	    continue;
 	  
 	  if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

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