lra-assigns.c (find_hard_regno_for): Add 1 to the cost of call saved registers.
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 10 May 2013 15:26:31 +0000 (15:26 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 10 May 2013 15:26:31 +0000 (15:26 +0000)
2013-05-10  Vladimir Makarov  <vmakarov@redhat.com>

* lra-assigns.c (find_hard_regno_for): Add 1 to the cost of call
saved registers.

From-SVN: r198792

gcc/ChangeLog
gcc/lra-assigns.c

index 151d842..7da1973 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-10  Vladimir Makarov  <vmakarov@redhat.com>
+
+       * lra-assigns.c (find_hard_regno_for): Add 1 to the cost of call
+       saved registers.
+
 2013-05-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        * config/arm/t-rtems-eabi: Remove mthumb/march=armv7 multilib.
index 3f8a899..78bc2e7 100644 (file)
@@ -598,7 +598,7 @@ find_hard_regno_for (int regno, int *cost, int try_only_hard_regno)
                && ! df_regs_ever_live_p (hard_regno + j))
              /* It needs save restore.  */
              hard_regno_costs[hard_regno]
-               += 2 * ENTRY_BLOCK_PTR->next_bb->frequency;
+               += 2 * ENTRY_BLOCK_PTR->next_bb->frequency + 1;
          priority = targetm.register_priority (hard_regno);
          if (best_hard_regno < 0 || hard_regno_costs[hard_regno] < best_cost
              || (hard_regno_costs[hard_regno] == best_cost