public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: RFA: patch for PR48455
Date: Wed, 13 Apr 2011 17:09:00 -0000	[thread overview]
Message-ID: <4DA5D8B3.2080003@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

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'.






[-- Attachment #2: pr48455.patch --]
[-- Type: text/plain, Size: 1643 bytes --]

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)

             reply	other threads:[~2011-04-13 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 17:09 Vladimir Makarov [this message]
2011-04-13 17:12 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA5D8B3.2080003@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).