Patchwork [lra] patch to fix crafty compilation on ppc64

login
register
mail settings
Submitter Vladimir Makarov
Date June 24, 2011, 6:21 p.m.
Message ID <4E04D5B7.4080200@redhat.com>
Download mbox | patch
Permalink /patch/101852/
State New
Headers show

Comments

Vladimir Makarov - June 24, 2011, 6:21 p.m.
The following patch fixes compilation abort of SPEC2000 crafty on ppc64.

The patch was successfully bootstrapped on x86-64, ppc64, and ia64.

2011-06-24  Vladimir Makarov <vmakarov@redhat.com>

         * lra-constraints.c (curr_insn_transform): Process operator
         duplications.

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 175381)
+++ lra-constraints.c	(working copy)
@@ -3051,8 +3051,22 @@  curr_insn_transform (void)
   if (before != NULL_RTX || after != NULL_RTX || max_regno_before != max_reg_num ())
     change_p = true;
   if (change_p)
-    /* Something changes -- process the insn.  */
-    lra_update_insn_regno_info (curr_insn);
+    {
+      /* Process operator duplications.  We do it here to guarantee
+	 their processing after operands processing.  Generally
+	 speaking, we could do this probably in the previous loop
+	 because a common practice is to enumerate the operators after
+	 their operands.  */
+      for (i = 0; i < n_dups; i++)
+	{
+	  int ndup = curr_static_id->dup_num[i];
+
+	  if (curr_static_id->operand[ndup].is_operator)
+	    *curr_id->dup_loc[i] = *curr_id->operand_loc[ndup];
+	}
+      /* Something changes -- process the insn.  */
+      lra_update_insn_regno_info (curr_insn);
+    }
   lra_process_new_insns (curr_insn, before, after, "Inserting insn reload");
   return change_p;
 }