]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
global.c (global_conflicts): Prevent allocation of call clobbered hard regs to pseudo...
authorOlivier Hainque <hainque@act-europe.fr>
Mon, 14 Apr 2003 21:51:07 +0000 (23:51 +0200)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 14 Apr 2003 21:51:07 +0000 (17:51 -0400)
* global.c (global_conflicts): Prevent allocation of call clobbered
hard regs to pseudos live across abnormal edges, as later passes are
not ready to handle them.

From-SVN: r65597

gcc/ChangeLog
gcc/global.c

index a62b6a0775df6711e9be64d7537e4f0029a1b2c9..93af039800d6fe3c40ea537ef560f8c9543e6b26 100644 (file)
 
 2003-04-14  Olivier Hainque <hainque@act-europe.fr>
 
+       * global.c (global_conflicts): Prevent allocation of call clobbered
+       hard regs to pseudos live across abnormal edges, as later passes are
+       not ready to handle them.
+
         * fold-const.c (fold): Reorder tests for conditional expressions.
 
         * expr.c (highest_pow2_factor): Return unsigned.
index b35777ee6d632174b4d15fb18232ad7fdb0ae581..d5636084ce7d6fa686a0fab9b8e2f282153136f7 100644 (file)
@@ -703,26 +703,38 @@ global_conflicts ()
            scan the instruction that makes either X or Y become live.  */
        record_conflicts (block_start_allocnos, ax);
 
-#ifdef STACK_REGS
+       /* Pseudos can't go in stack regs at the start of a basic block that
+          is reached by an abnormal edge. Likewise for call clobbered regs,
+          because because caller-save, fixup_abnormal_edges, and possibly
+          the table driven EH machinery are not quite ready to handle such
+          regs live across such edges.  */
        {
-         /* Pseudos can't go in stack regs at the start of a basic block
-            that is reached by an abnormal edge.  */
-
          edge e;
+
          for (e = b->pred; e ; e = e->pred_next)
            if (e->flags & EDGE_ABNORMAL)
              break;
+
          if (e != NULL)
            {
+#ifdef STACK_REGS
              EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
-               {
-                 allocno[ax].no_stack_reg = 1;
-               });
+                                            {
+                                              allocno[ax].no_stack_reg = 1;
+                                            });
              for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
                record_one_conflict (ax);
+#endif
+
+             /* No need to record conflicts for call clobbered regs if we have
+                nonlocal labels around, as we don't ever try to allocate such
+                regs in this case.  */
+             if (! current_function_has_nonlocal_label)
+               for (ax = 0; ax < FIRST_PSEUDO_REGISTER; ax++)
+                 if (call_used_regs [ax])
+                   record_one_conflict (ax);
            }
        }
-#endif
       }
 
       insn = b->head;