Patchwork patch to fix PR55050 and PR55068

login
register
mail settings
Submitter Vladimir Makarov
Date Oct. 25, 2012, 4:20 a.m.
Message ID <5088BE12.7080905@redhat.com>
Download mbox | patch
Permalink /patch/194037/
State New
Headers show

Comments

Vladimir Makarov - Oct. 25, 2012, 4:20 a.m.
The following patch is to solve

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55050

and probably

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55068

Code updating equivalences was added to IRA.  It was supposed for LRA.  
It might create problems for reload because it creates inconsistency in 
dealing with equivs in reload and IRA.

The patch was successfully bootstrapped on x86/x86-64.

Committed as rev. 192797.

2012-10-24  Vladimir Makarov  <vmakarov@redhat.com>

     PR bootstrap/55068
     PR regression/55050
     * ira.c (setup_reg_renumber): Fix assert.
     * ira-emit.c (emit_move_list): Update equivalences only for LRA.

Patch

Index: ira.c
===================================================================
--- ira.c	(revision 192742)
+++ ira.c	(working copy)
@@ -1989,6 +1989,7 @@  setup_reg_renumber (void)
 	      ira_assert (!optimize || flag_caller_saves
 			  || (ALLOCNO_CALLS_CROSSED_NUM (a)
 			      == ALLOCNO_CHEAP_CALLS_CROSSED_NUM (a))
+			  || regno >= ira_reg_equiv_len
 			  || ira_equiv_no_lvalue_p (regno));
 	      caller_save_needed = 1;
 	    }
Index: ira-emit.c
===================================================================
--- ira-emit.c	(revision 192742)
+++ ira-emit.c	(working copy)
@@ -947,7 +947,8 @@  emit_move_list (move_t list, int freq)
 		= gen_rtx_INSN_LIST (VOIDmode, insn, reg_equiv_init (regno));
 	    }
 	}
-      ira_update_equiv_info_by_shuffle_insn (to_regno, from_regno, list->insn);
+      if (ira_use_lra_p)
+	ira_update_equiv_info_by_shuffle_insn (to_regno, from_regno, list->insn);
       emit_insn (list->insn);
       mode = ALLOCNO_MODE (list->to);
       aclass = ALLOCNO_CLASS (list->to);