]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/41241 (bootstrap comparison failure)
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 4 Sep 2009 19:36:26 +0000 (19:36 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 4 Sep 2009 19:36:26 +0000 (19:36 +0000)
2009-09-04  Vladimir Makarov  <vmakarov@redhat.com>

PR bootstrap/41241
* ira.c (update_equiv_reg): Revert my previous patch for the PR.
* reginfo.c (resize_reg_info): Call allocate_reg_info if necessary.
(reginfo_init): Don't call allocate_reg_info.

From-SVN: r151440

gcc/ChangeLog
gcc/ira.c
gcc/reginfo.c

index 21737846a3c47b731952f2efd03d1b19152cd540..3523c0b8dc30b3f4267be98ed024e1a8c03445fc 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-04  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR bootstrap/41241
+       * ira.c (update_equiv_reg): Revert my previous patch for the PR.
+       * reginfo.c (resize_reg_info): Call allocate_reg_info if necessary.
+       (reginfo_init): Don't call allocate_reg_info.
+
 2009-09-04  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/41262
index b9b10dc9d3c8be46c7bdcd075dc41db61ef271a2..b960f769534a490188d588eab762488364df6394 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2384,9 +2384,21 @@ update_equiv_regs (void)
 
          /* We only handle the case of a pseudo register being set
             once, or always to the same value.  */
+         /* ??? The mn10200 port breaks if we add equivalences for
+            values that need an ADDRESS_REGS register and set them equivalent
+            to a MEM of a pseudo.  The actual problem is in the over-conservative
+            handling of INPADDR_ADDRESS / INPUT_ADDRESS / INPUT triples in
+            calculate_needs, but we traditionally work around this problem
+            here by rejecting equivalences when the destination is in a register
+            that's likely spilled.  This is fragile, of course, since the
+            preferred class of a pseudo depends on all instructions that set
+            or use it.  */
+
          if (!REG_P (dest)
              || (regno = REGNO (dest)) < FIRST_PSEUDO_REGISTER
-             || reg_equiv[regno].init_insns == const0_rtx)
+             || reg_equiv[regno].init_insns == const0_rtx
+             || (CLASS_LIKELY_SPILLED_P (reg_preferred_class (regno))
+                 && MEM_P (src) && ! reg_equiv[regno].is_arg_equivalence))
            {
              /* This might be setting a SUBREG of a pseudo, a pseudo that is
                 also set somewhere else to a constant.  */
index 9b03d64f5904cc9b59d244e0544eae928033355b..0f11c91a3de1f5a0177442ed929bcc8071d37e82 100644 (file)
@@ -952,13 +952,18 @@ allocate_reg_info (void)
 }
 
 
-/* Resize reg info. The new elements will be uninitialized.  */
+/* Resize reg info. The new elements will be uninitialized.  Return
+   TRUE if new elements (for new pseudos) were added.  */
 bool
 resize_reg_info (void)
 {
   int old;
 
-  gcc_assert (reg_pref != NULL);
+  if (reg_pref == NULL)
+    {
+      allocate_reg_info ();
+      return true;
+    }
   if (reg_info_size == max_reg_num ())
     return false;
   old = reg_info_size;
@@ -1000,7 +1005,6 @@ reginfo_init (void)
   /* This prevents dump_flow_info from losing if called
      before reginfo is run.  */
   reg_pref = NULL;
-  allocate_reg_info ();
   /* No more global register variables may be declared.  */
   no_global_reg_vars = 1;
   return 1;