Patchwork RFA: patch for PR48455

login
register
mail settings
Submitter Vladimir Makarov
Date April 13, 2011, 5:09 p.m.
Message ID <4DA5D8B3.2080003@redhat.com>
Download mbox | patch
Permalink /patch/91073/
State New
Headers show

Comments

Vladimir Makarov - April 13, 2011, 5:09 p.m.
The following patch should improve code size which degradation for arm 
is reported on

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

Is it ok to commit?  The patch was successfully bootstrapped on x86-64 
and i686 with H.J.'s autotester options.

2011-04-13  Vladimir Makarov <vmakarov@redhat.com>

         PR rtl-optimization/48455
         * ira-costs.c (find_costs_and_classes): Use i_mem_cost instead of
         `temp_costs->mem_cost'.
Jeff Law - April 13, 2011, 5:12 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/13/11 11:09, Vladimir Makarov wrote:
> The following patch should improve code size which degradation for arm
> is reported on
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48455
> 
> Is it ok to commit?  The patch was successfully bootstrapped on x86-64
> and i686 with H.J.'s autotester options.
> 
> 2011-04-13  Vladimir Makarov <vmakarov@redhat.com>
> 
>         PR rtl-optimization/48455
>         * ira-costs.c (find_costs_and_classes): Use i_mem_cost instead of
>         `temp_costs->mem_cost'.
OK.
jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNpdmPAAoJEBRtltQi2kC78cUIAKd41H7LfANsVOH5tuY/ZmR9
X7aRad0exevCKhRYuGBfKtZHJ1OHCvOTHxOr6Xvak/BUNuMkuZPaazc5c4rg1HRc
Fo43AM+NuxLHvNWi+gvN4sY1fhrGjYquwu5TNQ7TM26Njvbb1s1JwQtUEdly02yg
HDwSqxqurAfkAD3xrE2+sOUF/WfbE4DFS/OKCqCLr8AnQPXYu8dqA3QRjqoSuBcB
3sd0x/gTplMaJUk/B+B8xrxlOSZSooRCYp3SQhsvEWTUdhNCAYrrh2HDC26H4H9P
Uusc8PHnolU0JL5onwN/mGqu2+mrgJ8Z4Xbc2cSAMnOlf6ATQhpdcTvFUeFA7Rw=
=cfcO
-----END PGP SIGNATURE-----

Patch

Index: ira-costs.c
===================================================================
--- ira-costs.c	(revision 172376)
+++ ira-costs.c	(working copy)
@@ -1646,44 +1646,44 @@ 
 		  for (k = cost_classes_ptr->num - 1; k >= 0; k--)
 		    {
 		      add_cost = a_costs[k];
 		      if (add_cost > 0 && INT_MAX - add_cost < i_costs[k])
 			i_costs[k] = INT_MAX;
 		      else
 			i_costs[k] += add_cost;
 		    }
 		  add_cost = COSTS (costs, a_num)->mem_cost;
 		  if (add_cost > 0 && INT_MAX - add_cost < i_mem_cost)
 		    i_mem_cost = INT_MAX;
 		  else
 		    i_mem_cost += add_cost;
 #ifdef FORBIDDEN_INC_DEC_CLASSES
 		  if (in_inc_dec[a_num])
 		    inc_dec_p = true;
 #endif
 		}
 	    }
 	  if (equiv_savings < 0)
-	    temp_costs->mem_cost = -equiv_savings;
+	    i_mem_cost = -equiv_savings;
 	  else if (equiv_savings > 0)
 	    {
-	      temp_costs->mem_cost = 0;
+	      i_mem_cost = 0;
 	      for (k = cost_classes_ptr->num - 1; k >= 0; k--)
 		i_costs[k] += equiv_savings;
 	    }
 
 	  best_cost = (1 << (HOST_BITS_PER_INT - 2)) - 1;
 	  best = ALL_REGS;
 	  alt_class = NO_REGS;
 	  /* Find best common class for all allocnos with the same
 	     regno.  */
 	  for (k = 0; k < cost_classes_ptr->num; k++)
 	    {
 	      rclass = cost_classes[k];
 	      /* Ignore classes that are too small for this operand or
 		 invalid for an operand that was auto-incremented.  */
 	      if (! contains_reg_of_mode[rclass][PSEUDO_REGNO_MODE (i)]
 #ifdef FORBIDDEN_INC_DEC_CLASSES
 		  || (inc_dec_p && forbidden_inc_dec_class[rclass])
 #endif
 #ifdef CANNOT_CHANGE_MODE_CLASS
 		  || invalid_mode_change_p (i, (enum reg_class) rclass)