]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/37243 (IRA causes wrong code generation)
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 29 Aug 2008 16:16:45 +0000 (16:16 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 29 Aug 2008 16:16:45 +0000 (16:16 +0000)
2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-opt/37243
* ira-color (ira_fast_allocation): Don't assign hard registers to
global allocnos.

From-SVN: r139769

gcc/ChangeLog
gcc/ira-color.c

index 04a7e4d55abfc92373e186407ddaf1f6389cff63..b299eb1a3b8e762ab40d20c258dc27bcc3ddb9bb 100644 (file)
@@ -1,3 +1,9 @@
+2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-opt/37243
+       * ira-color (ira_fast_allocation): Don't assign hard registers to
+       global allocnos.
+
 2008-08-29  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/37278
index f3e4673ad6fdf6c6e7a3a085a238ae991d64b269..0cbb4978dba800311d35b01c120a6905e8ba31af 100644 (file)
@@ -2912,13 +2912,17 @@ ira_fast_allocation (void)
   for (i = 0; i < num; i++)
     {
       a = sorted_allocnos[i];
+      ALLOCNO_ASSIGNED_P (a) = true;
+      ALLOCNO_HARD_REGNO (a) = -1;
+      /* Live info about hard registers are absent when OPTIMIZE==0.
+        So try to assign hard-registers only to local allocnos.  */
+      if (!optimize && REG_BASIC_BLOCK (ALLOCNO_REGNO (a)) == REG_BLOCK_GLOBAL)
+       continue;
       COPY_HARD_REG_SET (conflict_hard_regs, ALLOCNO_CONFLICT_HARD_REGS (a));
       for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
        for (j =  r->start; j <= r->finish; j++)
          IOR_HARD_REG_SET (conflict_hard_regs, used_hard_regs[j]);
       cover_class = ALLOCNO_COVER_CLASS (a);
-      ALLOCNO_ASSIGNED_P (a) = true;
-      ALLOCNO_HARD_REGNO (a) = -1;
       if (hard_reg_set_subset_p (reg_class_contents[cover_class],
                                 conflict_hard_regs))
        continue;