OSDN Git Service

* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
[pf3gnuchains/gcc-fork.git] / gcc / ra-build.c
index 5f0b3e1..7601a31 100644 (file)
@@ -1,5 +1,5 @@
 /* Graph coloring register allocator
 /* Graph coloring register allocator
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Michael Matz <matz@suse.de>
    and Daniel Berlin <dan@cgsoftware.com>
 
    Contributed by Michael Matz <matz@suse.de>
    and Daniel Berlin <dan@cgsoftware.com>
 
 
 struct curr_use;
 
 
 struct curr_use;
 
-static unsigned HOST_WIDE_INT rtx_to_undefined PARAMS ((rtx));
-static bitmap find_sub_conflicts PARAMS ((struct web_part *, unsigned int));
-static bitmap get_sub_conflicts PARAMS ((struct web_part *, unsigned int));
-static unsigned int undef_to_size_word PARAMS ((rtx, unsigned HOST_WIDE_INT *));
-static bitmap undef_to_bitmap PARAMS ((struct web_part *,
-                                      unsigned HOST_WIDE_INT *));
-static struct web_part * find_web_part_1 PARAMS ((struct web_part *));
+static unsigned HOST_WIDE_INT rtx_to_undefined (rtx);
+static bitmap find_sub_conflicts (struct web_part *, unsigned int);
+static bitmap get_sub_conflicts (struct web_part *, unsigned int);
+static unsigned int undef_to_size_word (rtx, unsigned HOST_WIDE_INT *);
+static bitmap undef_to_bitmap (struct web_part *,
+                              unsigned HOST_WIDE_INT *);
+static struct web_part * find_web_part_1 (struct web_part *);
 static struct web_part * union_web_part_roots
 static struct web_part * union_web_part_roots
-                               PARAMS ((struct web_part *, struct web_part *));
-static int defuse_overlap_p_1 PARAMS ((rtx, struct curr_use *));
-static int live_out_1 PARAMS ((struct df *, struct curr_use *, rtx));
-static int live_out PARAMS ((struct df *, struct curr_use *, rtx));
-static rtx live_in_edge PARAMS (( struct df *, struct curr_use *, edge));
-static void live_in PARAMS ((struct df *, struct curr_use *, rtx));
-static int copy_insn_p PARAMS ((rtx, rtx *, rtx *));
-static void remember_move PARAMS ((rtx));
-static void handle_asm_insn PARAMS ((struct df *, rtx));
-static void prune_hardregs_for_mode PARAMS ((HARD_REG_SET *,
-                                            enum machine_mode));
-static void init_one_web_common PARAMS ((struct web *, rtx));
-static void init_one_web PARAMS ((struct web *, rtx));
-static void reinit_one_web PARAMS ((struct web *, rtx));
-static struct web * add_subweb PARAMS ((struct web *, rtx));
-static struct web * add_subweb_2 PARAMS ((struct web *, unsigned int));
-static void init_web_parts PARAMS ((struct df *));
-static void copy_conflict_list PARAMS ((struct web *));
-static void add_conflict_edge PARAMS ((struct web *, struct web *));
-static void build_inverse_webs PARAMS ((struct web *));
-static void copy_web PARAMS ((struct web *, struct web_link **));
-static void compare_and_free_webs PARAMS ((struct web_link **));
-static void init_webs_defs_uses PARAMS ((void));
-static unsigned int parts_to_webs_1 PARAMS ((struct df *, struct web_link **,
-                                            struct df_link *));
-static void parts_to_webs PARAMS ((struct df *));
-static void reset_conflicts PARAMS ((void));
+                               (struct web_part *, struct web_part *);
+static int defuse_overlap_p_1 (rtx, struct curr_use *);
+static int live_out_1 (struct df *, struct curr_use *, rtx);
+static int live_out (struct df *, struct curr_use *, rtx);
+static rtx live_in_edge ( struct df *, struct curr_use *, edge);
+static void live_in (struct df *, struct curr_use *, rtx);
+static int copy_insn_p (rtx, rtx *, rtx *);
+static void remember_move (rtx);
+static void handle_asm_insn (struct df *, rtx);
+static void prune_hardregs_for_mode (HARD_REG_SET *, enum machine_mode);
+static void init_one_web_common (struct web *, rtx);
+static void init_one_web (struct web *, rtx);
+static void reinit_one_web (struct web *, rtx);
+static struct web * add_subweb (struct web *, rtx);
+static struct web * add_subweb_2 (struct web *, unsigned int);
+static void init_web_parts (struct df *);
+static void copy_conflict_list (struct web *);
+static void add_conflict_edge (struct web *, struct web *);
+static void build_inverse_webs (struct web *);
+static void copy_web (struct web *, struct web_link **);
+static void compare_and_free_webs (struct web_link **);
+static void init_webs_defs_uses (void);
+static unsigned int parts_to_webs_1 (struct df *, struct web_link **,
+                                    struct df_link *);
+static void parts_to_webs (struct df *);
+static void reset_conflicts (void);
 #if 0
 #if 0
-static void check_conflict_numbers PARAMS ((void));
+static void check_conflict_numbers (void)
 #endif
 #endif
-static void conflicts_between_webs PARAMS ((struct df *));
-static void remember_web_was_spilled PARAMS ((struct web *));
-static void detect_spill_temps PARAMS ((void));
-static int contains_pseudo PARAMS ((rtx));
-static int want_to_remat PARAMS ((rtx x));
-static void detect_remat_webs PARAMS ((void));
-static void determine_web_costs PARAMS ((void));
-static void detect_webs_set_in_cond_jump PARAMS ((void));
-static void make_webs PARAMS ((struct df *));
-static void moves_to_webs PARAMS ((struct df *));
-static void connect_rmw_web_parts PARAMS ((struct df *));
-static void update_regnos_mentioned PARAMS ((void));
-static void livethrough_conflicts_bb PARAMS ((basic_block));
-static void init_bb_info PARAMS ((void));
-static void free_bb_info PARAMS ((void));
-static void build_web_parts_and_conflicts PARAMS ((struct df *));
+static void conflicts_between_webs (struct df *);
+static void remember_web_was_spilled (struct web *);
+static void detect_spill_temps (void);
+static int contains_pseudo (rtx);
+static int want_to_remat (rtx x);
+static void detect_remat_webs (void);
+static void determine_web_costs (void);
+static void detect_webs_set_in_cond_jump (void);
+static void make_webs (struct df *);
+static void moves_to_webs (struct df *);
+static void connect_rmw_web_parts (struct df *);
+static void update_regnos_mentioned (void);
+static void livethrough_conflicts_bb (basic_block);
+static void init_bb_info (void);
+static void free_bb_info (void);
+static void build_web_parts_and_conflicts (struct df *);
 
 
 /* A sbitmap of DF_REF_IDs of uses, which are live over an abnormal
 
 
 /* A sbitmap of DF_REF_IDs of uses, which are live over an abnormal
@@ -181,8 +180,7 @@ struct ra_bb_info
    as an integer.  */
 
 unsigned int
    as an integer.  */
 
 unsigned int
-rtx_to_bits (x)
-     rtx x;
+rtx_to_bits (rtx x)
 {
   unsigned int len, beg;
   len = GET_MODE_SIZE (GET_MODE (x));
 {
   unsigned int len, beg;
   len = GET_MODE_SIZE (GET_MODE (x));
@@ -193,8 +191,7 @@ rtx_to_bits (x)
 /* X is a REG or SUBREG rtx.  Return the bytes it touches as a bitmask.  */
 
 static unsigned HOST_WIDE_INT
 /* X is a REG or SUBREG rtx.  Return the bytes it touches as a bitmask.  */
 
 static unsigned HOST_WIDE_INT
-rtx_to_undefined (x)
-     rtx x;
+rtx_to_undefined (rtx x)
 {
   unsigned int len, beg;
   unsigned HOST_WIDE_INT ret;
 {
   unsigned int len, beg;
   unsigned HOST_WIDE_INT ret;
@@ -225,17 +222,13 @@ int *number_seen;
    not NULL.  */
 
 static int
    not NULL.  */
 
 static int
-copy_insn_p (insn, source, target)
-     rtx insn;
-     rtx *source;
-     rtx *target;
+copy_insn_p (rtx insn, rtx *source, rtx *target)
 {
   rtx d, s;
   unsigned int d_regno, s_regno;
   int uid = INSN_UID (insn);
 
 {
   rtx d, s;
   unsigned int d_regno, s_regno;
   int uid = INSN_UID (insn);
 
-  if (!INSN_P (insn))
-    abort ();
+  gcc_assert (INSN_P (insn));
 
   /* First look, if we already saw this insn.  */
   if (copy_cache[uid].seen)
 
   /* First look, if we already saw this insn.  */
   if (copy_cache[uid].seen)
@@ -265,13 +258,13 @@ copy_insn_p (insn, source, target)
      coalescing (the check for this is in remember_move() below).  */
   while (GET_CODE (d) == STRICT_LOW_PART)
     d = XEXP (d, 0);
      coalescing (the check for this is in remember_move() below).  */
   while (GET_CODE (d) == STRICT_LOW_PART)
     d = XEXP (d, 0);
-  if (GET_CODE (d) != REG
-      && (GET_CODE (d) != SUBREG || GET_CODE (SUBREG_REG (d)) != REG))
+  if (!REG_P (d)
+      && (GET_CODE (d) != SUBREG || !REG_P (SUBREG_REG (d))))
     return 0;
   while (GET_CODE (s) == STRICT_LOW_PART)
     s = XEXP (s, 0);
     return 0;
   while (GET_CODE (s) == STRICT_LOW_PART)
     s = XEXP (s, 0);
-  if (GET_CODE (s) != REG
-      && (GET_CODE (s) != SUBREG || GET_CODE (SUBREG_REG (s)) != REG))
+  if (!REG_P (s)
+      && (GET_CODE (s) != SUBREG || !REG_P (SUBREG_REG (s))))
     return 0;
 
   s_regno = (unsigned) REGNO (GET_CODE (s) == SUBREG ? SUBREG_REG (s) : s);
     return 0;
 
   s_regno = (unsigned) REGNO (GET_CODE (s) == SUBREG ? SUBREG_REG (s) : s);
@@ -308,9 +301,7 @@ copy_insn_p (insn, source, target)
    exist yet in WP.  */
 
 static bitmap
    exist yet in WP.  */
 
 static bitmap
-find_sub_conflicts (wp, size_word)
-     struct web_part *wp;
-     unsigned int size_word;
+find_sub_conflicts (struct web_part *wp, unsigned int size_word)
 {
   struct tagged_conflict *cl;
   cl = wp->sub_conflicts;
 {
   struct tagged_conflict *cl;
   cl = wp->sub_conflicts;
@@ -324,15 +315,12 @@ find_sub_conflicts (wp, size_word)
    doesn't exist.  I.e. this never returns NULL.  */
 
 static bitmap
    doesn't exist.  I.e. this never returns NULL.  */
 
 static bitmap
-get_sub_conflicts (wp, size_word)
-     struct web_part *wp;
-     unsigned int size_word;
+get_sub_conflicts (struct web_part *wp, unsigned int size_word)
 {
   bitmap b = find_sub_conflicts (wp, size_word);
   if (!b)
     {
 {
   bitmap b = find_sub_conflicts (wp, size_word);
   if (!b)
     {
-      struct tagged_conflict *cl =
-       (struct tagged_conflict *) ra_alloc (sizeof *cl);
+      struct tagged_conflict *cl = ra_alloc (sizeof *cl);
       cl->conflicts = BITMAP_XMALLOC ();
       cl->size_word = size_word;
       cl->next = wp->sub_conflicts;
       cl->conflicts = BITMAP_XMALLOC ();
       cl->size_word = size_word;
       cl->next = wp->sub_conflicts;
@@ -383,9 +371,7 @@ static struct undef_table_s {
    */
 
 static unsigned int
    */
 
 static unsigned int
-undef_to_size_word (reg, undefined)
-     rtx reg;
-     unsigned HOST_WIDE_INT *undefined;
+undef_to_size_word (rtx reg, unsigned HOST_WIDE_INT *undefined)
 {
   /* When only the lower four bits are possibly set, we use
      a fast lookup table.  */
 {
   /* When only the lower four bits are possibly set, we use
      a fast lookup table.  */
@@ -398,8 +384,9 @@ undef_to_size_word (reg, undefined)
     }
 
   /* Otherwise we handle certain cases directly.  */
     }
 
   /* Otherwise we handle certain cases directly.  */
-  switch (*undefined)
-    {
+  if (*undefined <= 0xffff)
+    switch ((int) *undefined)
+      {
       case 0x00f0 : *undefined = 0; return BL_TO_WORD (4, 4);
       case 0x00ff : *undefined = 0; return BL_TO_WORD (0, 8);
       case 0x0f00 : *undefined = 0; return BL_TO_WORD (8, 4);
       case 0x00f0 : *undefined = 0; return BL_TO_WORD (4, 4);
       case 0x00ff : *undefined = 0; return BL_TO_WORD (0, 8);
       case 0x0f00 : *undefined = 0; return BL_TO_WORD (8, 4);
@@ -413,29 +400,25 @@ undef_to_size_word (reg, undefined)
       case 0xff00 : *undefined = 0; return BL_TO_WORD (8, 8);
       case 0xfff0 : *undefined = 0xf0; return BL_TO_WORD (8, 8);
       case 0xffff : *undefined = 0; return BL_TO_WORD (0, 16);
       case 0xff00 : *undefined = 0; return BL_TO_WORD (8, 8);
       case 0xfff0 : *undefined = 0xf0; return BL_TO_WORD (8, 8);
       case 0xffff : *undefined = 0; return BL_TO_WORD (0, 16);
+      }
 
 
-      /* And if nothing matched fall back to the general solution.
-        For now unknown undefined bytes are converted to sequences
-        of maximal length 4 bytes.  We could make this larger if
-        necessary.  */
-      default :
-       {
-         unsigned HOST_WIDE_INT u = *undefined;
-         int word;
-         struct undef_table_s tab;
-         for (word = 0; (u & 15) == 0; word += 4)
-           u >>= 4;
-         u = u & 15;
-         tab = undef_table[u];
-         u = tab.new_undef;
-         u = (*undefined & ~((unsigned HOST_WIDE_INT)15 << word))
-             | (u << word);
-         *undefined = u;
-         /* Size remains the same, only the begin is moved up move bytes.  */
-         return tab.size_word + BL_TO_WORD (word, 0);
-       }
-       break;
-    }
+  /* And if nothing matched fall back to the general solution.  For
+     now unknown undefined bytes are converted to sequences of maximal
+     length 4 bytes.  We could make this larger if necessary.  */
+  {
+    unsigned HOST_WIDE_INT u = *undefined;
+    int word;
+    struct undef_table_s tab;
+    for (word = 0; (u & 15) == 0; word += 4)
+      u >>= 4;
+    u = u & 15;
+    tab = undef_table[u];
+    u = tab.new_undef;
+    u = (*undefined & ~((unsigned HOST_WIDE_INT)15 << word)) | (u << word);
+    *undefined = u;
+    /* Size remains the same, only the begin is moved up move bytes.  */
+    return tab.size_word + BL_TO_WORD (word, 0);
+  }
 }
 
 /* Put the above three functions together.  For a set of undefined bytes
 }
 
 /* Put the above three functions together.  For a set of undefined bytes
@@ -444,9 +427,7 @@ undef_to_size_word (reg, undefined)
    covered by the part for that bitmap.  */
 
 static bitmap
    covered by the part for that bitmap.  */
 
 static bitmap
-undef_to_bitmap (wp, undefined)
-     struct web_part *wp;
-     unsigned HOST_WIDE_INT *undefined;
+undef_to_bitmap (struct web_part *wp, unsigned HOST_WIDE_INT *undefined)
 {
   unsigned int size_word = undef_to_size_word (DF_REF_REAL_REG (wp->ref),
                                               undefined);
 {
   unsigned int size_word = undef_to_size_word (DF_REF_REAL_REG (wp->ref),
                                               undefined);
@@ -457,8 +438,7 @@ undef_to_bitmap (wp, undefined)
    it compresses the path.  P may not be NULL.  */
 
 static struct web_part *
    it compresses the path.  P may not be NULL.  */
 
 static struct web_part *
-find_web_part_1 (p)
-     struct web_part *p;
+find_web_part_1 (struct web_part *p)
 {
   struct web_part *r = p;
   struct web_part *p_next;
 {
   struct web_part *r = p;
   struct web_part *p_next;
@@ -484,8 +464,7 @@ find_web_part_1 (p)
    The root of the resulting (possibly larger) web part is returned.  */
 
 static struct web_part *
    The root of the resulting (possibly larger) web part is returned.  */
 
 static struct web_part *
-union_web_part_roots (r1, r2)
-     struct web_part *r1, *r2;
+union_web_part_roots (struct web_part *r1, struct web_part *r2)
 {
   if (r1 != r2)
     {
 {
   if (r1 != r2)
     {
@@ -524,8 +503,7 @@ union_web_part_roots (r1, r2)
            for (cl2 = r2->sub_conflicts; cl2; cl2 = cl2->next)
              if (cl1->size_word == cl2->size_word)
                {
            for (cl2 = r2->sub_conflicts; cl2; cl2 = cl2->next)
              if (cl1->size_word == cl2->size_word)
                {
-                 bitmap_operation (cl1->conflicts, cl1->conflicts,
-                                   cl2->conflicts, BITMAP_IOR);
+                 bitmap_ior_into (cl1->conflicts, cl2->conflicts);
                  BITMAP_XFREE (cl2->conflicts);
                  cl2->conflicts = NULL;
                }
                  BITMAP_XFREE (cl2->conflicts);
                  cl2->conflicts = NULL;
                }
@@ -556,40 +534,40 @@ union_web_part_roots (r1, r2)
 /* Remember that we've handled a given move, so we don't reprocess it.  */
 
 static void
 /* Remember that we've handled a given move, so we don't reprocess it.  */
 
 static void
-remember_move (insn)
-     rtx insn;
+remember_move (rtx insn)
 {
   if (!TEST_BIT (move_handled, INSN_UID (insn)))
     {
       rtx s, d;
 {
   if (!TEST_BIT (move_handled, INSN_UID (insn)))
     {
       rtx s, d;
+      int ret;
+      struct df_link *slink = DF_INSN_USES (df, insn);
+      struct df_link *link = DF_INSN_DEFS (df, insn);
+      
       SET_BIT (move_handled, INSN_UID (insn));
       SET_BIT (move_handled, INSN_UID (insn));
-      if (copy_insn_p (insn, &s, &d))
-       {
-         /* Some sanity test for the copy insn.  */
-         struct df_link *slink = DF_INSN_USES (df, insn);
-         struct df_link *link = DF_INSN_DEFS (df, insn);
-         if (!link || !link->ref || !slink || !slink->ref)
-           abort ();
-         /* The following (link->next != 0) happens when a hardreg
-            is used in wider mode (REG:DI %eax).  Then df.* creates
-            a def/use for each hardreg contained therein.  We only
-            allow hardregs here.  */
-         if (link->next
-             && DF_REF_REGNO (link->next->ref) >= FIRST_PSEUDO_REGISTER)
-           abort ();
-       }
-      else
-       abort ();
+      ret = copy_insn_p (insn, &s, &d);
+      gcc_assert (ret);
+      
+      /* Some sanity test for the copy insn.  */
+      gcc_assert (link && link->ref);
+      gcc_assert (slink && slink->ref);
+      /* The following (link->next != 0) happens when a hardreg
+         is used in wider mode (REG:DI %eax).  Then df.* creates
+         a def/use for each hardreg contained therein.  We only
+         allow hardregs here.  */
+      gcc_assert (!link->next
+                 || DF_REF_REGNO (link->next->ref)
+                     < FIRST_PSEUDO_REGISTER);
+      
       /* XXX for now we don't remember move insns involving any subregs.
         Those would be difficult to coalesce (we would need to implement
         handling of all the subwebs in the allocator, including that such
         subwebs could be source and target of coalescing).  */
       /* XXX for now we don't remember move insns involving any subregs.
         Those would be difficult to coalesce (we would need to implement
         handling of all the subwebs in the allocator, including that such
         subwebs could be source and target of coalescing).  */
-      if (GET_CODE (s) == REG && GET_CODE (d) == REG)
+      if (REG_P (s) && REG_P (d))
        {
        {
-         struct move *m = (struct move *) ra_calloc (sizeof (struct move));
+         struct move *m = ra_calloc (sizeof (struct move));
          struct move_list *ml;
          m->insn = insn;
          struct move_list *ml;
          m->insn = insn;
-         ml = (struct move_list *) ra_alloc (sizeof (struct move_list));
+         ml = ra_alloc (sizeof (struct move_list));
          ml->move = m;
          ml->next = wl_moves;
          wl_moves = ml;
          ml->move = m;
          ml->next = wl_moves;
          wl_moves = ml;
@@ -625,7 +603,7 @@ struct curr_use {
    4 if both are SUBREG's of different size, but have bytes in common.
    -1 is a special case, for when DEF and USE refer to the same regno, but
       have for other reasons no bits in common (can only happen with
    4 if both are SUBREG's of different size, but have bytes in common.
    -1 is a special case, for when DEF and USE refer to the same regno, but
       have for other reasons no bits in common (can only happen with
-      subregs refering to different words, or to words which already were
+      subregs referring to different words, or to words which already were
       defined for this USE).
    Furthermore it modifies use->undefined to clear the bits which get defined
    by DEF (only for cases with partial overlap).
       defined for this USE).
    Furthermore it modifies use->undefined to clear the bits which get defined
    by DEF (only for cases with partial overlap).
@@ -633,9 +611,7 @@ struct curr_use {
    otherwise a test is needed to track the already defined bytes.  */
 
 static int
    otherwise a test is needed to track the already defined bytes.  */
 
 static int
-defuse_overlap_p_1 (def, use)
-     rtx def;
-     struct curr_use *use;
+defuse_overlap_p_1 (rtx def, struct curr_use *use)
 {
   int mode = 0;
   if (def == use->x)
 {
   int mode = 0;
   if (def == use->x)
@@ -670,7 +646,7 @@ defuse_overlap_p_1 (def, use)
             if they refer to the same word.  */
          if (SUBREG_BYTE (def) == SUBREG_BYTE (use->x))
            return 1;
             if they refer to the same word.  */
          if (SUBREG_BYTE (def) == SUBREG_BYTE (use->x))
            return 1;
-       /* Now the more difficult part: the same regno is refered, but the
+       /* Now the more difficult part: the same regno is referred, but the
           sizes of the references or the words differ.  E.g.
            (subreg:SI (reg:CDI a) 0) and (subreg:DI (reg:CDI a) 2) do not
           overlap, whereas the latter overlaps with (subreg:SI (reg:CDI a) 3).
           sizes of the references or the words differ.  E.g.
            (subreg:SI (reg:CDI a) 0) and (subreg:DI (reg:CDI a) 2) do not
           overlap, whereas the latter overlaps with (subreg:SI (reg:CDI a) 3).
@@ -692,7 +668,7 @@ defuse_overlap_p_1 (def, use)
          return (old_u != use->undefined) ? 4 : -1;
        }
       default:
          return (old_u != use->undefined) ? 4 : -1;
        }
       default:
-        abort ();
+        gcc_unreachable ();
     }
 }
 
     }
 }
 
@@ -712,10 +688,7 @@ defuse_overlap_p_1 (def, use)
    this insn.  */
 
 static int
    this insn.  */
 
 static int
-live_out_1 (df, use, insn)
-     struct df *df ATTRIBUTE_UNUSED;
-     struct curr_use *use;
-     rtx insn;
+live_out_1 (struct df *df ATTRIBUTE_UNUSED, struct curr_use *use, rtx insn)
 {
   int defined = 0;
   int uid = INSN_UID (insn);
 {
   int defined = 0;
   int uid = INSN_UID (insn);
@@ -737,7 +710,7 @@ live_out_1 (df, use, insn)
 
       /* We want to access the root webpart.  */
       wp = find_web_part (wp);
 
       /* We want to access the root webpart.  */
       wp = find_web_part (wp);
-      if (GET_CODE (insn) == CALL_INSN)
+      if (CALL_P (insn))
        wp->crosses_call = 1;
       else if (copy_insn_p (insn, &s, NULL))
        source_regno = REGNO (GET_CODE (s) == SUBREG ? SUBREG_REG (s) : s);
        wp->crosses_call = 1;
       else if (copy_insn_p (insn, &s, NULL))
        source_regno = REGNO (GET_CODE (s) == SUBREG ? SUBREG_REG (s) : s);
@@ -847,8 +820,7 @@ live_out_1 (df, use, insn)
        {
          /* If this insn doesn't completely define the USE, increment also
             it's spanned deaths count (if this insn contains a death).  */
        {
          /* If this insn doesn't completely define the USE, increment also
             it's spanned deaths count (if this insn contains a death).  */
-         if (uid >= death_insns_max_uid)
-           abort ();
+         gcc_assert (uid < death_insns_max_uid);
          if (TEST_BIT (insns_with_deaths, uid))
            wp->spanned_deaths++;
          use->undefined = final_undef;
          if (TEST_BIT (insns_with_deaths, uid))
            wp->spanned_deaths++;
          use->undefined = final_undef;
@@ -867,10 +839,7 @@ live_out_1 (df, use, insn)
    this insn).  */
 
 static inline int
    this insn).  */
 
 static inline int
-live_out (df, use, insn)
-     struct df *df;
-     struct curr_use *use;
-     rtx insn;
+live_out (struct df *df, struct curr_use *use, rtx insn)
 {
   unsigned int uid = INSN_UID (insn);
   if (visit_trace[uid].wp
 {
   unsigned int uid = INSN_UID (insn);
   if (visit_trace[uid].wp
@@ -898,10 +867,7 @@ live_out (df, use, insn)
    which uses are live at the end of that basic block.  */
 
 static rtx
    which uses are live at the end of that basic block.  */
 
 static rtx
-live_in_edge (df, use, e)
-     struct df *df;
-     struct curr_use *use;
-     edge e;
+live_in_edge (struct df *df, struct curr_use *use, edge e)
 {
   struct ra_bb_info *info_pred;
   rtx next_insn;
 {
   struct ra_bb_info *info_pred;
   rtx next_insn;
@@ -916,7 +882,7 @@ live_in_edge (df, use, e)
     use->live_over_abnormal = 1;
   bitmap_set_bit (live_at_end[e->src->index], DF_REF_ID (use->wp->ref));
   info_pred = (struct ra_bb_info *) e->src->aux;
     use->live_over_abnormal = 1;
   bitmap_set_bit (live_at_end[e->src->index], DF_REF_ID (use->wp->ref));
   info_pred = (struct ra_bb_info *) e->src->aux;
-  next_insn = e->src->end;
+  next_insn = BB_END (e->src);
 
   /* If the last insn of the pred. block doesn't completely define the
      current use, we need to check the block.  */
 
   /* If the last insn of the pred. block doesn't completely define the
      current use, we need to check the block.  */
@@ -931,7 +897,7 @@ live_in_edge (df, use, e)
             creation to later.  */
          bitmap_set_bit (info_pred->live_throughout,
                          DF_REF_ID (use->wp->ref));
             creation to later.  */
          bitmap_set_bit (info_pred->live_throughout,
                          DF_REF_ID (use->wp->ref));
-         next_insn = e->src->head;
+         next_insn = BB_HEAD (e->src);
        }
       return next_insn;
     }
        }
       return next_insn;
     }
@@ -947,10 +913,7 @@ live_in_edge (df, use, e)
    def-use chains, and all defs during that chain are noted.  */
 
 static void
    def-use chains, and all defs during that chain are noted.  */
 
 static void
-live_in (df, use, insn)
-     struct df *df;
-     struct curr_use *use;
-     rtx insn;
+live_in (struct df *df, struct curr_use *use, rtx insn)
 {
   unsigned int loc_vpass = visited_pass;
 
 {
   unsigned int loc_vpass = visited_pass;
 
@@ -960,6 +923,7 @@ live_in (df, use, insn)
      are allowed.  */
   while (1)
     {
      are allowed.  */
   while (1)
     {
+      unsigned int i;
       int uid = INSN_UID (insn);
       basic_block bb = BLOCK_FOR_INSN (insn);
       number_seen[uid]++;
       int uid = INSN_UID (insn);
       basic_block bb = BLOCK_FOR_INSN (insn);
       number_seen[uid]++;
@@ -976,7 +940,7 @@ live_in (df, use, insn)
          edge e;
          unsigned HOST_WIDE_INT undef = use->undefined;
          struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
          edge e;
          unsigned HOST_WIDE_INT undef = use->undefined;
          struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
-         if ((e = bb->pred) == NULL)
+         if (EDGE_COUNT (bb->preds) == 0)
            return;
          /* We now check, if we already traversed the predecessors of this
             block for the current pass and the current set of undefined
            return;
          /* We now check, if we already traversed the predecessors of this
             block for the current pass and the current set of undefined
@@ -988,8 +952,9 @@ live_in (df, use, insn)
          info->pass = loc_vpass;
          info->undefined = undef;
          /* All but the last predecessor are handled recursively.  */
          info->pass = loc_vpass;
          info->undefined = undef;
          /* All but the last predecessor are handled recursively.  */
-         for (; e->pred_next; e = e->pred_next)
+         for (e = NULL, i = 0; i < EDGE_COUNT (bb->preds) - 1; i++)
            {
            {
+             e = EDGE_PRED (bb, i);
              insn = live_in_edge (df, use, e);
              if (insn)
                live_in (df, use, insn);
              insn = live_in_edge (df, use, e);
              if (insn)
                live_in (df, use, insn);
@@ -1010,7 +975,7 @@ live_in (df, use, insn)
    pass.  */
 
 static void
    pass.  */
 
 static void
-update_regnos_mentioned ()
+update_regnos_mentioned (void)
 {
   int last_uid = last_max_uid;
   rtx insn;
 {
   int last_uid = last_max_uid;
   rtx insn;
@@ -1052,13 +1017,13 @@ update_regnos_mentioned ()
    spanned_deaths members.  */
 
 static void
    spanned_deaths members.  */
 
 static void
-livethrough_conflicts_bb (bb)
-     basic_block bb;
+livethrough_conflicts_bb (basic_block bb)
 {
   struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
   rtx insn;
   bitmap all_defs;
 {
   struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
   rtx insn;
   bitmap all_defs;
-  int first, use_id;
+  int first;
+  unsigned use_id;
   unsigned int deaths = 0;
   unsigned int contains_call = 0;
 
   unsigned int deaths = 0;
   unsigned int contains_call = 0;
 
@@ -1069,7 +1034,7 @@ livethrough_conflicts_bb (bb)
   /* First collect the IDs of all defs, count the number of death
      containing insns, and if there's some call_insn here.  */
   all_defs = BITMAP_XMALLOC ();
   /* First collect the IDs of all defs, count the number of death
      containing insns, and if there's some call_insn here.  */
   all_defs = BITMAP_XMALLOC ();
-  for (insn = bb->head; insn; insn = NEXT_INSN (insn))
+  for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn))
     {
       if (INSN_P (insn))
        {
     {
       if (INSN_P (insn))
        {
@@ -1081,27 +1046,33 @@ livethrough_conflicts_bb (bb)
            bitmap_set_bit (all_defs, DF_REF_ID (info.defs[n]));
          if (TEST_BIT (insns_with_deaths, INSN_UID (insn)))
            deaths++;
            bitmap_set_bit (all_defs, DF_REF_ID (info.defs[n]));
          if (TEST_BIT (insns_with_deaths, INSN_UID (insn)))
            deaths++;
-         if (GET_CODE (insn) == CALL_INSN)
+         if (CALL_P (insn))
            contains_call = 1;
        }
            contains_call = 1;
        }
-      if (insn == bb->end)
+      if (insn == BB_END (bb))
        break;
     }
 
   /* And now, if we have found anything, make all live_through
      uses conflict with all defs, and update their other members.  */
        break;
     }
 
   /* And now, if we have found anything, make all live_through
      uses conflict with all defs, and update their other members.  */
-  if (deaths > 0 || bitmap_first_set_bit (all_defs) >= 0)
-    EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id,
-      {
-        struct web_part *wp = &web_parts[df->def_id + use_id];
-        unsigned int bl = rtx_to_bits (DF_REF_REG (wp->ref));
-        bitmap conflicts;
-        wp = find_web_part (wp);
-        wp->spanned_deaths += deaths;
-       wp->crosses_call |= contains_call;
-        conflicts = get_sub_conflicts (wp, bl);
-        bitmap_operation (conflicts, conflicts, all_defs, BITMAP_IOR);
-      });
+  if (deaths > 0
+      || contains_call
+      || !bitmap_empty_p (all_defs))
+    {
+      bitmap_iterator bi;
+
+      EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id, bi)
+       {
+         struct web_part *wp = &web_parts[df->def_id + use_id];
+         unsigned int bl = rtx_to_bits (DF_REF_REG (wp->ref));
+         bitmap conflicts;
+         wp = find_web_part (wp);
+         wp->spanned_deaths += deaths;
+         wp->crosses_call |= contains_call;
+         conflicts = get_sub_conflicts (wp, bl);
+         bitmap_ior_into (conflicts, all_defs);
+       }
+    }
 
   BITMAP_XFREE (all_defs);
 }
 
   BITMAP_XFREE (all_defs);
 }
@@ -1110,13 +1081,12 @@ livethrough_conflicts_bb (bb)
    building live ranges.  */
 
 static void
    building live ranges.  */
 
 static void
-init_bb_info ()
+init_bb_info (void)
 {
   basic_block bb;
   FOR_ALL_BB (bb)
     {
 {
   basic_block bb;
   FOR_ALL_BB (bb)
     {
-      struct ra_bb_info *info =
-       (struct ra_bb_info *) xcalloc (1, sizeof *info);
+      struct ra_bb_info *info = xcalloc (1, sizeof *info);
       info->regnos_mentioned = BITMAP_XMALLOC ();
       info->live_throughout = BITMAP_XMALLOC ();
       info->old_aux = bb->aux;
       info->regnos_mentioned = BITMAP_XMALLOC ();
       info->live_throughout = BITMAP_XMALLOC ();
       info->old_aux = bb->aux;
@@ -1127,7 +1097,7 @@ init_bb_info ()
 /* Free that per basic block info.  */
 
 static void
 /* Free that per basic block info.  */
 
 static void
-free_bb_info ()
+free_bb_info (void)
 {
   basic_block bb;
   FOR_ALL_BB (bb)
 {
   basic_block bb;
   FOR_ALL_BB (bb)
@@ -1145,16 +1115,14 @@ free_bb_info ()
    their conflicts.  */
 
 static void
    their conflicts.  */
 
 static void
-build_web_parts_and_conflicts (df)
-     struct df *df;
+build_web_parts_and_conflicts (struct df *df)
 {
   struct df_link *link;
   struct curr_use use;
   basic_block bb;
 
 {
   struct df_link *link;
   struct curr_use use;
   basic_block bb;
 
-  number_seen = (int *) xcalloc (get_max_uid (), sizeof (int));
-  visit_trace = (struct visit_trace *) xcalloc (get_max_uid (),
-                                               sizeof (visit_trace[0]));
+  number_seen = xcalloc (get_max_uid (), sizeof (int));
+  visit_trace = xcalloc (get_max_uid (), sizeof (visit_trace[0]));
   update_regnos_mentioned ();
 
   /* Here's the main loop.
   update_regnos_mentioned ();
 
   /* Here's the main loop.
@@ -1204,8 +1172,7 @@ build_web_parts_and_conflicts (df)
    read-mod-write instruction), so we must reconnect such webs.  */
 
 static void
    read-mod-write instruction), so we must reconnect such webs.  */
 
 static void
-connect_rmw_web_parts (df)
-     struct df *df;
+connect_rmw_web_parts (struct df *df)
 {
   unsigned int i;
 
 {
   unsigned int i;
 
@@ -1234,9 +1201,7 @@ connect_rmw_web_parts (df)
 /* Deletes all hardregs from *S which are not allowed for MODE.  */
 
 static void
 /* Deletes all hardregs from *S which are not allowed for MODE.  */
 
 static void
-prune_hardregs_for_mode (s, mode)
-     HARD_REG_SET *s;
-     enum machine_mode mode;
+prune_hardregs_for_mode (HARD_REG_SET *s, enum machine_mode mode)
 {
   AND_HARD_REG_SET (*s, hardregs_for_mode[(int) mode]);
 }
 {
   AND_HARD_REG_SET (*s, hardregs_for_mode[(int) mode]);
 }
@@ -1244,18 +1209,15 @@ prune_hardregs_for_mode (s, mode)
 /* Initialize the members of a web, which are deducible from REG.  */
 
 static void
 /* Initialize the members of a web, which are deducible from REG.  */
 
 static void
-init_one_web_common (web, reg)
-     struct web *web;
-     rtx reg;
+init_one_web_common (struct web *web, rtx reg)
 {
 {
-  if (GET_CODE (reg) != REG)
-    abort ();
+  gcc_assert (REG_P (reg));
   /* web->id isn't initialized here.  */
   web->regno = REGNO (reg);
   web->orig_x = reg;
   if (!web->dlink)
     {
   /* web->id isn't initialized here.  */
   web->regno = REGNO (reg);
   web->orig_x = reg;
   if (!web->dlink)
     {
-      web->dlink = (struct dlist *) ra_calloc (sizeof (struct dlist));
+      web->dlink = ra_calloc (sizeof (struct dlist));
       DLIST_WEB (web->dlink) = web;
     }
   /* XXX
       DLIST_WEB (web->dlink) = web;
     }
   /* XXX
@@ -1308,15 +1270,13 @@ init_one_web_common (web, reg)
       AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
       prune_hardregs_for_mode (&web->usable_regs,
                               PSEUDO_REGNO_MODE (web->regno));
       AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
       prune_hardregs_for_mode (&web->usable_regs,
                               PSEUDO_REGNO_MODE (web->regno));
-#ifdef CLASS_CANNOT_CHANGE_MODE
+#ifdef CANNOT_CHANGE_MODE_CLASS
       if (web->mode_changed)
       if (web->mode_changed)
-        AND_COMPL_HARD_REG_SET (web->usable_regs, reg_class_contents[
-                                 (int) CLASS_CANNOT_CHANGE_MODE]);
+        AND_COMPL_HARD_REG_SET (web->usable_regs, invalid_mode_change_regs);
 #endif
       web->num_freedom = hard_regs_count (web->usable_regs);
       web->num_freedom -= web->add_hardregs;
 #endif
       web->num_freedom = hard_regs_count (web->usable_regs);
       web->num_freedom -= web->add_hardregs;
-      if (!web->num_freedom)
-       abort();
+      gcc_assert (web->num_freedom);
     }
   COPY_HARD_REG_SET (web->orig_usable_regs, web->usable_regs);
 }
     }
   COPY_HARD_REG_SET (web->orig_usable_regs, web->usable_regs);
 }
@@ -1324,9 +1284,7 @@ init_one_web_common (web, reg)
 /* Initializes WEBs members from REG or zero them.  */
 
 static void
 /* Initializes WEBs members from REG or zero them.  */
 
 static void
-init_one_web (web, reg)
-     struct web *web;
-     rtx reg;
+init_one_web (struct web *web, rtx reg)
 {
   memset (web, 0, sizeof (struct web));
   init_one_web_common (web, reg);
 {
   memset (web, 0, sizeof (struct web));
   init_one_web_common (web, reg);
@@ -1338,9 +1296,7 @@ init_one_web (web, reg)
    members.  */
 
 static void
    members.  */
 
 static void
-reinit_one_web (web, reg)
-     struct web *web;
-     rtx reg;
+reinit_one_web (struct web *web, rtx reg)
 {
   web->old_color = web->color + 1;
   init_one_web_common (web, reg);
 {
   web->old_color = web->color + 1;
   init_one_web_common (web, reg);
@@ -1354,6 +1310,7 @@ reinit_one_web (web, reg)
   web->artificial = 0;
   web->live_over_abnormal = 0;
   web->mode_changed = 0;
   web->artificial = 0;
   web->live_over_abnormal = 0;
   web->mode_changed = 0;
+  web->subreg_stripped = 0;
   web->move_related = 0;
   web->in_load = 0;
   web->target_of_spilled_move = 0;
   web->move_related = 0;
   web->in_load = 0;
   web->target_of_spilled_move = 0;
@@ -1370,24 +1327,19 @@ reinit_one_web (web, reg)
   web->stack_slot = NULL;
   web->pattern = NULL;
   web->alias = NULL;
   web->stack_slot = NULL;
   web->pattern = NULL;
   web->alias = NULL;
-  if (web->moves)
-    abort ();
-  if (!web->useless_conflicts)
-    abort ();
+  gcc_assert (!web->moves);
+  gcc_assert (web->useless_conflicts);
 }
 
 /* Insert and returns a subweb corresponding to REG into WEB (which
    becomes its super web).  It must not exist already.  */
 
 static struct web *
 }
 
 /* Insert and returns a subweb corresponding to REG into WEB (which
    becomes its super web).  It must not exist already.  */
 
 static struct web *
-add_subweb (web, reg)
-     struct web *web;
-     rtx reg;
+add_subweb (struct web *web, rtx reg)
 {
   struct web *w;
 {
   struct web *w;
-  if (GET_CODE (reg) != SUBREG)
-    abort ();
-  w = (struct web *) xmalloc (sizeof (struct web));
+  gcc_assert (GET_CODE (reg) == SUBREG);
+  w = xmalloc (sizeof (struct web));
   /* Copy most content from parent-web.  */
   *w = *web;
   /* And initialize the private stuff.  */
   /* Copy most content from parent-web.  */
   *w = *web;
   /* And initialize the private stuff.  */
@@ -1408,9 +1360,7 @@ add_subweb (web, reg)
    In difference to add_subweb() this marks the new subweb as artificial.  */
 
 static struct web *
    In difference to add_subweb() this marks the new subweb as artificial.  */
 
 static struct web *
-add_subweb_2 (web, size_word)
-     struct web *web;
-     unsigned int size_word;
+add_subweb_2 (struct web *web, unsigned int  size_word)
 {
   /* To get a correct mode for the to be produced subreg, we don't want to
      simply do a mode_for_size() for the mode_class of the whole web.
 {
   /* To get a correct mode for the to be produced subreg, we don't want to
      simply do a mode_for_size() for the mode_class of the whole web.
@@ -1426,8 +1376,7 @@ add_subweb_2 (web, size_word)
   mode = mode_for_size (size, GET_MODE_CLASS (GET_MODE (ref_rtx)), 0);
   if (mode == BLKmode)
     mode = mode_for_size (size, MODE_INT, 0);
   mode = mode_for_size (size, GET_MODE_CLASS (GET_MODE (ref_rtx)), 0);
   if (mode == BLKmode)
     mode = mode_for_size (size, MODE_INT, 0);
-  if (mode == BLKmode)
-    abort ();
+  gcc_assert (mode != BLKmode);
   web = add_subweb (web, gen_rtx_SUBREG (mode, web->orig_x,
                                         BYTE_BEGIN (size_word)));
   web->artificial = 1;
   web = add_subweb (web, gen_rtx_SUBREG (mode, web->orig_x,
                                         BYTE_BEGIN (size_word)));
   web->artificial = 1;
@@ -1437,8 +1386,7 @@ add_subweb_2 (web, size_word)
 /* Initialize all the web parts we are going to need.  */
 
 static void
 /* Initialize all the web parts we are going to need.  */
 
 static void
-init_web_parts (df)
-     struct df *df;
+init_web_parts (struct df *df)
 {
   int regno;
   unsigned int no;
 {
   int regno;
   unsigned int no;
@@ -1447,15 +1395,14 @@ init_web_parts (df)
     {
       if (df->defs[no])
        {
     {
       if (df->defs[no])
        {
-         if (no < last_def_id && web_parts[no].ref != df->defs[no])
-           abort ();
+         gcc_assert (no >= last_def_id || web_parts[no].ref == df->defs[no]);
          web_parts[no].ref = df->defs[no];
          /* Uplink might be set from the last iteration.  */
          if (!web_parts[no].uplink)
            num_webs++;
        }
       else
          web_parts[no].ref = df->defs[no];
          /* Uplink might be set from the last iteration.  */
          if (!web_parts[no].uplink)
            num_webs++;
        }
       else
-       /* The last iteration might have left .ref set, while df_analyse()
+       /* The last iteration might have left .ref set, while df_analyze()
           removed that ref (due to a removed copy insn) from the df->defs[]
           array.  As we don't check for that in realloc_web_parts()
           we do that here.  */
           removed that ref (due to a removed copy insn) from the df->defs[]
           array.  As we don't check for that in realloc_web_parts()
           we do that here.  */
@@ -1465,9 +1412,8 @@ init_web_parts (df)
     {
       if (df->uses[no])
        {
     {
       if (df->uses[no])
        {
-         if (no < last_use_id
-             && web_parts[no + df->def_id].ref != df->uses[no])
-           abort ();
+         gcc_assert (no >= last_use_id
+                     || web_parts[no + df->def_id].ref == df->uses[no]);
          web_parts[no + df->def_id].ref = df->uses[no];
          if (!web_parts[no + df->def_id].uplink)
            num_webs++;
          web_parts[no + df->def_id].ref = df->uses[no];
          if (!web_parts[no + df->def_id].uplink)
            num_webs++;
@@ -1512,17 +1458,16 @@ init_web_parts (df)
    new conflicts, we copy it here to orig_conflict_list.  */
 
 static void
    new conflicts, we copy it here to orig_conflict_list.  */
 
 static void
-copy_conflict_list (web)
-     struct web *web;
+copy_conflict_list (struct web *web)
 {
   struct conflict_link *cl;
 {
   struct conflict_link *cl;
-  if (web->orig_conflict_list || web->have_orig_conflicts)
-    abort ();
+  gcc_assert (!web->orig_conflict_list);
+  gcc_assert (!web->have_orig_conflicts);
   web->have_orig_conflicts = 1;
   for (cl = web->conflict_list; cl; cl = cl->next)
     {
       struct conflict_link *ncl;
   web->have_orig_conflicts = 1;
   for (cl = web->conflict_list; cl; cl = cl->next)
     {
       struct conflict_link *ncl;
-      ncl = (struct conflict_link *) ra_alloc (sizeof *ncl);
+      ncl = ra_alloc (sizeof *ncl);
       ncl->t = cl->t;
       ncl->sub = NULL;
       ncl->next = web->orig_conflict_list;
       ncl->t = cl->t;
       ncl->sub = NULL;
       ncl->next = web->orig_conflict_list;
@@ -1532,7 +1477,7 @@ copy_conflict_list (web)
          struct sub_conflict *sl, *nsl;
          for (sl = cl->sub; sl; sl = sl->next)
            {
          struct sub_conflict *sl, *nsl;
          for (sl = cl->sub; sl; sl = sl->next)
            {
-             nsl = (struct sub_conflict *) ra_alloc (sizeof *nsl);
+             nsl = ra_alloc (sizeof *nsl);
              nsl->s = sl->s;
              nsl->t = sl->t;
              nsl->next = ncl->sub;
              nsl->s = sl->s;
              nsl->t = sl->t;
              nsl->next = ncl->sub;
@@ -1552,8 +1497,7 @@ copy_conflict_list (web)
    happen, if SUBREG webs are involved.  */
 
 static void
    happen, if SUBREG webs are involved.  */
 
 static void
-add_conflict_edge (from, to)
-     struct web *from, *to;
+add_conflict_edge (struct web *from, struct web *to)
 {
   if (from->type != PRECOLORED)
     {
 {
   if (from->type != PRECOLORED)
     {
@@ -1574,7 +1518,7 @@ add_conflict_edge (from, to)
        copy_conflict_list (pfrom);
       if (!TEST_BIT (sup_igraph, (pfrom->id * num_webs + pto->id)))
        {
        copy_conflict_list (pfrom);
       if (!TEST_BIT (sup_igraph, (pfrom->id * num_webs + pto->id)))
        {
-         cl = (struct conflict_link *) ra_alloc (sizeof (*cl));
+         cl = ra_alloc (sizeof (*cl));
          cl->t = pto;
          cl->sub = NULL;
          cl->next = pfrom->conflict_list;
          cl->t = pto;
          cl->sub = NULL;
          cl->next = pfrom->conflict_list;
@@ -1599,7 +1543,7 @@ add_conflict_edge (from, to)
             means we are not interested in this subconflict.  */
          if (!may_delete || cl->sub != NULL)
            {
             means we are not interested in this subconflict.  */
          if (!may_delete || cl->sub != NULL)
            {
-             sl = (struct sub_conflict *) ra_alloc (sizeof (*sl));
+             sl = ra_alloc (sizeof (*sl));
              sl->s = from;
              sl->t = to;
              sl->next = cl->sub;
              sl->s = from;
              sl->t = to;
              sl->next = cl->sub;
@@ -1618,16 +1562,14 @@ add_conflict_edge (from, to)
    already.  */
 
 void
    already.  */
 
 void
-record_conflict (web1, web2)
-     struct web *web1, *web2;
+record_conflict (struct web *web1, struct web *web2)
 {
   unsigned int id1 = web1->id, id2 = web2->id;
   unsigned int index = igraph_index (id1, id2);
   /* Trivial non-conflict or already recorded conflict.  */
   if (web1 == web2 || TEST_BIT (igraph, index))
     return;
 {
   unsigned int id1 = web1->id, id2 = web2->id;
   unsigned int index = igraph_index (id1, id2);
   /* Trivial non-conflict or already recorded conflict.  */
   if (web1 == web2 || TEST_BIT (igraph, index))
     return;
-  if (id1 == id2)
-    abort ();
+  gcc_assert (id1 != id2);
   /* As fixed_regs are no targets for allocation, conflicts with them
      are pointless.  */
   if ((web1->regno < FIRST_PSEUDO_REGISTER && fixed_regs[web1->regno])
   /* As fixed_regs are no targets for allocation, conflicts with them
      are pointless.  */
   if ((web1->regno < FIRST_PSEUDO_REGISTER && fixed_regs[web1->regno])
@@ -1671,8 +1613,7 @@ record_conflict (web1, web2)
    possible to exactly specify (W-Wy) for all already existing subwebs Wy.  */
 
 static void
    possible to exactly specify (W-Wy) for all already existing subwebs Wy.  */
 
 static void
-build_inverse_webs (web)
-     struct web *web;
+build_inverse_webs (struct web *web)
 {
   struct web *sweb = web->subreg_next;
   unsigned HOST_WIDE_INT undef;
 {
   struct web *sweb = web->subreg_next;
   unsigned HOST_WIDE_INT undef;
@@ -1697,12 +1638,10 @@ build_inverse_webs (web)
    Used for consistency checking.  */
 
 static void
    Used for consistency checking.  */
 
 static void
-copy_web (web, wl)
-     struct web *web;
-     struct web_link **wl;
+copy_web (struct web *web, struct web_link **wl)
 {
 {
-  struct web *cweb = (struct web *) xmalloc (sizeof *cweb);
-  struct web_link *link = (struct web_link *) ra_alloc (sizeof *link);
+  struct web *cweb = xmalloc (sizeof *cweb);
+  struct web_link *link = ra_alloc (sizeof *link);
   link->next = *wl;
   *wl = link;
   link->web = cweb;
   link->next = *wl;
   *wl = link;
   link->web = cweb;
@@ -1713,36 +1652,34 @@ copy_web (web, wl)
    with the global webs of the same ID.  For consistency checking.  */
 
 static void
    with the global webs of the same ID.  For consistency checking.  */
 
 static void
-compare_and_free_webs (link)
-     struct web_link **link;
+compare_and_free_webs (struct web_link **link)
 {
   struct web_link *wl;
   for (wl = *link; wl; wl = wl->next)
     {
       struct web *web1 = wl->web;
       struct web *web2 = ID2WEB (web1->id);
 {
   struct web_link *wl;
   for (wl = *link; wl; wl = wl->next)
     {
       struct web *web1 = wl->web;
       struct web *web2 = ID2WEB (web1->id);
-      if (web1->regno != web2->regno
-         || web1->crosses_call != web2->crosses_call
-         || web1->live_over_abnormal != web2->live_over_abnormal
-         || web1->mode_changed != web2->mode_changed
-         || !rtx_equal_p (web1->orig_x, web2->orig_x)
-         || web1->type != web2->type
-         /* Only compare num_defs/num_uses with non-hardreg webs.
-            E.g. the number of uses of the framepointer changes due to
-            inserting spill code.  */
-         || (web1->type != PRECOLORED &&
-             (web1->num_uses != web2->num_uses
-              || web1->num_defs != web2->num_defs)))
-       abort ();
+      gcc_assert (web1->regno == web2->regno);
+      gcc_assert (web1->mode_changed == web2->mode_changed);
+      gcc_assert (rtx_equal_p (web1->orig_x, web2->orig_x));
+      gcc_assert (web1->type == web2->type);
       if (web1->type != PRECOLORED)
        {
          unsigned int i;
       if (web1->type != PRECOLORED)
        {
          unsigned int i;
+
+         /* Only compare num_defs/num_uses with non-hardreg webs.
+             E.g. the number of uses of the framepointer changes due to
+             inserting spill code.  */
+         gcc_assert (web1->num_uses == web2->num_uses);
+         gcc_assert (web1->num_defs == web2->num_defs);
+         /* Similarly, if the framepointer was unreferenced originally
+             but we added spills, these fields may not match.  */
+         gcc_assert (web1->crosses_call == web2->crosses_call);
+         gcc_assert (web1->live_over_abnormal == web2->live_over_abnormal);
          for (i = 0; i < web1->num_defs; i++)
          for (i = 0; i < web1->num_defs; i++)
-           if (web1->defs[i] != web2->defs[i])
-             abort ();
+           gcc_assert (web1->defs[i] == web2->defs[i]);
          for (i = 0; i < web1->num_uses; i++)
          for (i = 0; i < web1->num_uses; i++)
-           if (web1->uses[i] != web2->uses[i])
-             abort ();
+           gcc_assert (web1->uses[i] == web2->uses[i]);
        }
       if (web1->type == PRECOLORED)
        {
        }
       if (web1->type == PRECOLORED)
        {
@@ -1759,7 +1696,7 @@ compare_and_free_webs (link)
 /* Setup and fill uses[] and defs[] arrays of the webs.  */
 
 static void
 /* Setup and fill uses[] and defs[] arrays of the webs.  */
 
 static void
-init_webs_defs_uses ()
+init_webs_defs_uses (void)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
@@ -1775,11 +1712,9 @@ init_webs_defs_uses ()
          continue;
        }
       if (web->num_defs)
          continue;
        }
       if (web->num_defs)
-        web->defs = (struct ref **) xmalloc (web->num_defs *
-                                            sizeof (web->defs[0]));
+        web->defs = xmalloc (web->num_defs * sizeof (web->defs[0]));
       if (web->num_uses)
       if (web->num_uses)
-        web->uses = (struct ref **) xmalloc (web->num_uses *
-                                            sizeof (web->uses[0]));
+        web->uses = xmalloc (web->num_uses * sizeof (web->uses[0]));
       def_i = use_i = 0;
       for (link = web->temp_refs; link; link = link->next)
        {
       def_i = use_i = 0;
       for (link = web->temp_refs; link; link = link->next)
        {
@@ -1789,8 +1724,8 @@ init_webs_defs_uses ()
            web->uses[use_i++] = link->ref;
        }
       web->temp_refs = NULL;
            web->uses[use_i++] = link->ref;
        }
       web->temp_refs = NULL;
-      if (def_i != web->num_defs || use_i != web->num_uses)
-       abort ();
+      gcc_assert (def_i == web->num_defs);
+      gcc_assert (use_i == web->num_uses);
     }
 }
 
     }
 }
 
@@ -1799,10 +1734,8 @@ init_webs_defs_uses ()
    up use2web and def2web arrays.  */
 
 static unsigned int
    up use2web and def2web arrays.  */
 
 static unsigned int
-parts_to_webs_1 (df, copy_webs, all_refs)
-     struct df *df;
-     struct web_link **copy_webs;
-     struct df_link *all_refs;
+parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
+                struct df_link *all_refs)
 {
   unsigned int i;
   unsigned int webnum;
 {
   unsigned int i;
   unsigned int webnum;
@@ -1839,7 +1772,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
             allocate a new one.  */
          if (ra_pass == 1)
            {
             allocate a new one.  */
          if (ra_pass == 1)
            {
-             web = (struct web *) xmalloc (sizeof (struct web));
+             web = xmalloc (sizeof (struct web));
              newid = last_num_webs++;
              init_one_web (web, GET_CODE (reg) == SUBREG
                                 ? SUBREG_REG (reg) : reg);
              newid = last_num_webs++;
              init_one_web (web, GET_CODE (reg) == SUBREG
                                 ? SUBREG_REG (reg) : reg);
@@ -1872,7 +1805,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
                  else
                    {
                      /* Else allocate a new one.  */
                  else
                    {
                      /* Else allocate a new one.  */
-                     web = (struct web *) xmalloc (sizeof (struct web));
+                     web = xmalloc (sizeof (struct web));
                      newid = last_num_webs++;
                    }
                }
                      newid = last_num_webs++;
                    }
                }
@@ -1892,11 +1825,13 @@ parts_to_webs_1 (df, copy_webs, all_refs)
          web->id = newid;
          web->temp_refs = NULL;
          webnum++;
          web->id = newid;
          web->temp_refs = NULL;
          webnum++;
-         if (web->regno < FIRST_PSEUDO_REGISTER && !hardreg2web[web->regno])
-           hardreg2web[web->regno] = web;
-         else if (web->regno < FIRST_PSEUDO_REGISTER
-                  && hardreg2web[web->regno] != web)
-           abort ();
+         if (web->regno < FIRST_PSEUDO_REGISTER)
+           {
+             if (!hardreg2web[web->regno])
+               hardreg2web[web->regno] = web;
+             else
+               gcc_assert (hardreg2web[web->regno] == web);
+           }
        }
 
       /* If this reference already had a web assigned, we are done.
        }
 
       /* If this reference already had a web assigned, we are done.
@@ -1911,13 +1846,16 @@ parts_to_webs_1 (df, copy_webs, all_refs)
          if ((DF_REF_FLAGS (ref) & DF_REF_MODE_CHANGE) != 0
              && web->regno >= FIRST_PSEUDO_REGISTER)
            web->mode_changed = 1;
          if ((DF_REF_FLAGS (ref) & DF_REF_MODE_CHANGE) != 0
              && web->regno >= FIRST_PSEUDO_REGISTER)
            web->mode_changed = 1;
+         if ((DF_REF_FLAGS (ref) & DF_REF_STRIPPED) != 0
+             && web->regno >= FIRST_PSEUDO_REGISTER)
+           web->subreg_stripped = 1;
          if (i >= def_id
              && TEST_BIT (live_over_abnormal, ref_id))
            web->live_over_abnormal = 1;
          /* And check, that it's not a newly allocated web.  This would be
             an inconsistency.  */
          if (i >= def_id
              && TEST_BIT (live_over_abnormal, ref_id))
            web->live_over_abnormal = 1;
          /* And check, that it's not a newly allocated web.  This would be
             an inconsistency.  */
-         if (!web->old_web || web->type == PRECOLORED)
-           abort ();
+         gcc_assert (web->old_web);
+         gcc_assert (web->type != PRECOLORED);
          continue;
        }
       /* In case this was no web part root, we need to initialize WEB
          continue;
        }
       /* In case this was no web part root, we need to initialize WEB
@@ -1939,8 +1877,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
 
       /* And the test, that if def2web[i] was NULL above, that we are _not_
         an old web.  */
 
       /* And the test, that if def2web[i] was NULL above, that we are _not_
         an old web.  */
-      if (web->old_web && web->type != PRECOLORED)
-       abort ();
+      gcc_assert (!web->old_web || web->type == PRECOLORED);
 
       /* Possible create a subweb, if this ref was a subreg.  */
       if (GET_CODE (reg) == SUBREG)
 
       /* Possible create a subweb, if this ref was a subreg.  */
       if (GET_CODE (reg) == SUBREG)
@@ -1949,8 +1886,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
          if (!subweb)
            {
              subweb = add_subweb (web, reg);
          if (!subweb)
            {
              subweb = add_subweb (web, reg);
-             if (web->old_web)
-               abort ();
+             gcc_assert (!web->old_web);
            }
        }
       else
            }
        }
       else
@@ -1960,6 +1896,9 @@ parts_to_webs_1 (df, copy_webs, all_refs)
       if ((DF_REF_FLAGS (ref) & DF_REF_MODE_CHANGE) != 0
          && web->regno >= FIRST_PSEUDO_REGISTER)
        web->mode_changed = 1;
       if ((DF_REF_FLAGS (ref) & DF_REF_MODE_CHANGE) != 0
          && web->regno >= FIRST_PSEUDO_REGISTER)
        web->mode_changed = 1;
+      if ((DF_REF_FLAGS (ref) & DF_REF_STRIPPED) != 0
+         && web->regno >= FIRST_PSEUDO_REGISTER)
+       web->subreg_stripped = 1;
 
       /* Setup def2web, or use2web, and increment num_defs or num_uses.  */
       if (i < def_id)
 
       /* Setup def2web, or use2web, and increment num_defs or num_uses.  */
       if (i < def_id)
@@ -1969,14 +1908,9 @@ parts_to_webs_1 (df, copy_webs, all_refs)
            {
              struct web *compare = def2web[i];
              if (i < last_def_id)
            {
              struct web *compare = def2web[i];
              if (i < last_def_id)
-               {
-                 if (web->old_web && compare != subweb)
-                   abort ();
-               }
-             if (!web->old_web && compare)
-               abort ();
-             if (compare && compare != subweb)
-               abort ();
+               gcc_assert (!web->old_web || compare == subweb);
+             gcc_assert (web->old_web || !compare);
+             gcc_assert (!compare || compare == subweb);
            }
          def2web[i] = subweb;
          web->num_defs++;
            }
          def2web[i] = subweb;
          web->num_defs++;
@@ -1986,15 +1920,11 @@ parts_to_webs_1 (df, copy_webs, all_refs)
          if (ra_pass > 1)
            {
              struct web *compare = use2web[ref_id];
          if (ra_pass > 1)
            {
              struct web *compare = use2web[ref_id];
-             if (ref_id < last_use_id)
-               {
-                 if (web->old_web && compare != subweb)
-                   abort ();
-               }
-             if (!web->old_web && compare)
-               abort ();
-             if (compare && compare != subweb)
-               abort ();
+             
+             gcc_assert (ref_id >= last_use_id
+                         || !web->old_web || compare == subweb);
+             gcc_assert (web->old_web || !compare);
+             gcc_assert (!compare || compare == subweb);
            }
          use2web[ref_id] = subweb;
          web->num_uses++;
            }
          use2web[ref_id] = subweb;
          web->num_uses++;
@@ -2004,8 +1934,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
     }
 
   /* We better now have exactly as many webs as we had web part roots.  */
     }
 
   /* We better now have exactly as many webs as we had web part roots.  */
-  if (webnum != num_webs)
-    abort ();
+  gcc_assert (webnum == num_webs);
 
   return webnum;
 }
 
   return webnum;
 }
@@ -2014,8 +1943,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
    other (i.e. without creating the conflict edges).  */
 
 static void
    other (i.e. without creating the conflict edges).  */
 
 static void
-parts_to_webs (df)
-     struct df *df;
+parts_to_webs (struct df *df)
 {
   unsigned int i;
   unsigned int webnum;
 {
   unsigned int i;
   unsigned int webnum;
@@ -2025,8 +1953,7 @@ parts_to_webs (df)
   num_subwebs = 0;
 
   /* First build webs and ordinary subwebs.  */
   num_subwebs = 0;
 
   /* First build webs and ordinary subwebs.  */
-  all_refs = (struct df_link *) xcalloc (df->def_id + df->use_id,
-                                        sizeof (all_refs[0]));
+  all_refs = xcalloc (df->def_id + df->use_id, sizeof (all_refs[0]));
   webnum = parts_to_webs_1 (df, &copy_webs, all_refs);
 
   /* Setup the webs for hardregs which are still missing (weren't
   webnum = parts_to_webs_1 (df, &copy_webs, all_refs);
 
   /* Setup the webs for hardregs which are still missing (weren't
@@ -2034,7 +1961,7 @@ parts_to_webs (df)
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     if (!hardreg2web[i])
       {
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     if (!hardreg2web[i])
       {
-       struct web *web = (struct web *) xmalloc (sizeof (struct web));
+       struct web *web = xmalloc (sizeof (struct web));
        init_one_web (web, gen_rtx_REG (reg_raw_mode[i], i));
        web->id = last_num_webs++;
        hardreg2web[web->regno] = web;
        init_one_web (web, gen_rtx_REG (reg_raw_mode[i], i));
        web->id = last_num_webs++;
        hardreg2web[web->regno] = web;
@@ -2055,8 +1982,7 @@ parts_to_webs (df)
       struct web *web;
       if (wp->uplink || !wp->ref)
        {
       struct web *web;
       if (wp->uplink || !wp->ref)
        {
-         if (wp->sub_conflicts)
-           abort ();
+         gcc_assert (!wp->sub_conflicts);
          continue;
        }
       web = def2web[i];
          continue;
        }
       web = def2web[i];
@@ -2082,7 +2008,7 @@ parts_to_webs (df)
     }
 
   /* Now that everyone has an ID, we can setup the id2web array.  */
     }
 
   /* Now that everyone has an ID, we can setup the id2web array.  */
-  id2web = (struct web **) xcalloc (webnum, sizeof (id2web[0]));
+  id2web = xcalloc (webnum, sizeof (id2web[0]));
   for (d = WEBS(INITIAL); d; d = d->next)
     {
       struct web *web = DLIST_WEB (d);
   for (d = WEBS(INITIAL); d; d = d->next)
     {
       struct web *web = DLIST_WEB (d);
@@ -2114,7 +2040,7 @@ parts_to_webs (df)
    conflicts.  */
 
 static void
    conflicts.  */
 
 static void
-reset_conflicts ()
+reset_conflicts (void)
 {
   unsigned int i;
   bitmap newwebs = BITMAP_XMALLOC ();
 {
   unsigned int i;
   bitmap newwebs = BITMAP_XMALLOC ();
@@ -2141,8 +2067,7 @@ reset_conflicts ()
          web->conflict_list = web->orig_conflict_list;
          web->orig_conflict_list = NULL;
        }
          web->conflict_list = web->orig_conflict_list;
          web->orig_conflict_list = NULL;
        }
-      if (web->orig_conflict_list)
-       abort ();
+      gcc_assert (!web->orig_conflict_list);
 
       /* New non-precolored webs, have no conflict list.  */
       if (web->type != PRECOLORED && !web->old_web)
 
       /* New non-precolored webs, have no conflict list.  */
       if (web->type != PRECOLORED && !web->old_web)
@@ -2151,15 +2076,13 @@ reset_conflicts ()
          /* Useless conflicts will be rebuilt completely.  But check
             for cleanliness, as the web might have come from the
             free list.  */
          /* Useless conflicts will be rebuilt completely.  But check
             for cleanliness, as the web might have come from the
             free list.  */
-         if (bitmap_first_set_bit (web->useless_conflicts) >= 0)
-           abort ();
+         gcc_assert (bitmap_empty_p (web->useless_conflicts));
        }
       else
        {
          /* Useless conflicts with new webs will be rebuilt if they
             are still there.  */
        }
       else
        {
          /* Useless conflicts with new webs will be rebuilt if they
             are still there.  */
-         bitmap_operation (web->useless_conflicts, web->useless_conflicts,
-                           newwebs, BITMAP_AND_COMPL);
+         bitmap_and_compl_into (web->useless_conflicts, newwebs);
          /* Go through all conflicts, and retain those to old webs.  */
          for (cl = web->conflict_list; cl; cl = cl->next)
            {
          /* Go through all conflicts, and retain those to old webs.  */
          for (cl = web->conflict_list; cl; cl = cl->next)
            {
@@ -2196,7 +2119,7 @@ reset_conflicts ()
 
 #if 0
 static void
 
 #if 0
 static void
-check_conflict_numbers ()
+check_conflict_numbers (void)
 {
   unsigned int i;
   for (i = 0; i < num_webs; i++)
 {
   unsigned int i;
   for (i = 0; i < num_webs; i++)
@@ -2207,8 +2130,7 @@ check_conflict_numbers ()
       for (cl = web->conflict_list; cl; cl = cl->next)
        if (cl->t->type != SELECT && cl->t->type != COALESCED)
          new_conf += 1 + cl->t->add_hardregs;
       for (cl = web->conflict_list; cl; cl = cl->next)
        if (cl->t->type != SELECT && cl->t->type != COALESCED)
          new_conf += 1 + cl->t->add_hardregs;
-      if (web->type != PRECOLORED && new_conf != web->num_conflicts)
-       abort ();
+      gcc_assert (web->type == PRECOLORED || new_conf == web->num_conflicts);
     }
 }
 #endif
     }
 }
 #endif
@@ -2227,16 +2149,13 @@ check_conflict_numbers ()
    in reality conflict get the same color.  */
 
 static void
    in reality conflict get the same color.  */
 
 static void
-conflicts_between_webs (df)
-     struct df *df;
+conflicts_between_webs (struct df *df)
 {
   unsigned int i;
 {
   unsigned int i;
-#ifdef STACK_REGS
   struct dlist *d;
   struct dlist *d;
-#endif
   bitmap ignore_defs = BITMAP_XMALLOC ();
   unsigned int have_ignored;
   bitmap ignore_defs = BITMAP_XMALLOC ();
   unsigned int have_ignored;
-  unsigned int *pass_cache = (unsigned int *) xcalloc (num_webs, sizeof (int));
+  unsigned int *pass_cache = xcalloc (num_webs, sizeof (int));
   unsigned int pass = 0;
 
   if (ra_pass > 1)
   unsigned int pass = 0;
 
   if (ra_pass > 1)
@@ -2252,7 +2171,7 @@ conflicts_between_webs (df)
   for (i = 0; i < df->def_id; i++)
     if (web_parts[i].ref == NULL)
       bitmap_set_bit (ignore_defs, i);
   for (i = 0; i < df->def_id; i++)
     if (web_parts[i].ref == NULL)
       bitmap_set_bit (ignore_defs, i);
-  have_ignored = (bitmap_first_set_bit (ignore_defs) >= 0);
+  have_ignored = !bitmap_empty_p (ignore_defs);
 
   /* Now record all conflicts between webs.  Note that we only check
      the conflict bitmaps of all defs.  Conflict bitmaps are only in
 
   /* Now record all conflicts between webs.  Note that we only check
      the conflict bitmaps of all defs.  Conflict bitmaps are only in
@@ -2275,11 +2194,12 @@ conflicts_between_webs (df)
       for (; cl; cl = cl->next)
         if (cl->conflicts)
          {
       for (; cl; cl = cl->next)
         if (cl->conflicts)
          {
-           int j;
+           unsigned j;
            struct web *web1 = find_subweb_2 (supweb1, cl->size_word);
            struct web *web1 = find_subweb_2 (supweb1, cl->size_word);
+           bitmap_iterator bi;
+
            if (have_ignored)
            if (have_ignored)
-             bitmap_operation (cl->conflicts, cl->conflicts, ignore_defs,
-                               BITMAP_AND_COMPL);
+             bitmap_and_compl_into (cl->conflicts, ignore_defs);
            /* We reduce the number of calls to record_conflict() with this
               pass thing.  record_conflict() itself also has some early-out
               optimizations, but here we can use the special properties of
            /* We reduce the number of calls to record_conflict() with this
               pass thing.  record_conflict() itself also has some early-out
               optimizations, but here we can use the special properties of
@@ -2291,8 +2211,7 @@ conflicts_between_webs (df)
            pass++;
 
            /* Note, that there are only defs in the conflicts bitset.  */
            pass++;
 
            /* Note, that there are only defs in the conflicts bitset.  */
-           EXECUTE_IF_SET_IN_BITMAP (
-             cl->conflicts, 0, j,
+           EXECUTE_IF_SET_IN_BITMAP (cl->conflicts, 0, j, bi)
              {
                struct web *web2 = def2web[j];
                unsigned int id2 = web2->id;
              {
                struct web *web2 = def2web[j];
                unsigned int id2 = web2->id;
@@ -2301,33 +2220,38 @@ conflicts_between_webs (df)
                    pass_cache[id2] = pass;
                    record_conflict (web1, web2);
                  }
                    pass_cache[id2] = pass;
                    record_conflict (web1, web2);
                  }
-             });
+             }
          }
     }
 
   free (pass_cache);
   BITMAP_XFREE (ignore_defs);
 
          }
     }
 
   free (pass_cache);
   BITMAP_XFREE (ignore_defs);
 
-#ifdef STACK_REGS
-  /* Pseudos can't go in stack regs if they are live at the beginning of
-     a block that is reached by an abnormal edge.  */
   for (d = WEBS(INITIAL); d; d = d->next)
     {
       struct web *web = DLIST_WEB (d);
       int j;
   for (d = WEBS(INITIAL); d; d = d->next)
     {
       struct web *web = DLIST_WEB (d);
       int j;
+
+      if (web->crosses_call)
+       for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
+         if (TEST_HARD_REG_BIT (regs_invalidated_by_call, j))
+           record_conflict (web, hardreg2web[j]);
+
+#ifdef STACK_REGS
+      /* Pseudos can't go in stack regs if they are live at the beginning of
+        a block that is reached by an abnormal edge.  */
       if (web->live_over_abnormal)
        for (j = FIRST_STACK_REG; j <= LAST_STACK_REG; j++)
          record_conflict (web, hardreg2web[j]);
       if (web->live_over_abnormal)
        for (j = FIRST_STACK_REG; j <= LAST_STACK_REG; j++)
          record_conflict (web, hardreg2web[j]);
-    }
 #endif
 #endif
+    }
 }
 
 /* Remember that a web was spilled, and change some characteristics
    accordingly.  */
 
 static void
 }
 
 /* Remember that a web was spilled, and change some characteristics
    accordingly.  */
 
 static void
-remember_web_was_spilled (web)
-     struct web *web;
+remember_web_was_spilled (struct web *web)
 {
   int i;
   unsigned int found_size = 0;
 {
   int i;
   unsigned int found_size = 0;
@@ -2363,14 +2287,12 @@ remember_web_was_spilled (web)
                       reg_class_contents[(int) GENERAL_REGS]);
   AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
   prune_hardregs_for_mode (&web->usable_regs, PSEUDO_REGNO_MODE (web->regno));
                       reg_class_contents[(int) GENERAL_REGS]);
   AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
   prune_hardregs_for_mode (&web->usable_regs, PSEUDO_REGNO_MODE (web->regno));
-#ifdef CLASS_CANNOT_CHANGE_MODE
+#ifdef CANNOT_CHANGE_MODE_CLASS
   if (web->mode_changed)
   if (web->mode_changed)
-    AND_COMPL_HARD_REG_SET (web->usable_regs, reg_class_contents[
-                             (int) CLASS_CANNOT_CHANGE_MODE]);
+    AND_COMPL_HARD_REG_SET (web->usable_regs, invalid_mode_change_regs);
 #endif
   web->num_freedom = hard_regs_count (web->usable_regs);
 #endif
   web->num_freedom = hard_regs_count (web->usable_regs);
-  if (!web->num_freedom)
-    abort();
+  gcc_assert (web->num_freedom);
   COPY_HARD_REG_SET (web->orig_usable_regs, web->usable_regs);
   /* Now look for a class, which is subset of our constraints, to
      setup add_hardregs, and regclass for debug output.  */
   COPY_HARD_REG_SET (web->orig_usable_regs, web->usable_regs);
   /* Now look for a class, which is subset of our constraints, to
      setup add_hardregs, and regclass for debug output.  */
@@ -2398,8 +2320,7 @@ remember_web_was_spilled (web)
   web->add_hardregs =
     CLASS_MAX_NREGS (web->regclass, PSEUDO_REGNO_MODE (web->regno)) - 1;
   web->num_freedom -= web->add_hardregs;
   web->add_hardregs =
     CLASS_MAX_NREGS (web->regclass, PSEUDO_REGNO_MODE (web->regno)) - 1;
   web->num_freedom -= web->add_hardregs;
-  if (!web->num_freedom)
-    abort();
+  gcc_assert (web->num_freedom);
   adjust -= 0 * web->add_hardregs;
   web->num_conflicts -= adjust;
 }
   adjust -= 0 * web->add_hardregs;
   web->num_conflicts -= adjust;
 }
@@ -2408,7 +2329,7 @@ remember_web_was_spilled (web)
    if it will be spillable in this pass.  */
 
 static void
    if it will be spillable in this pass.  */
 
 static void
-detect_spill_temps ()
+detect_spill_temps (void)
 {
   struct dlist *d;
   bitmap already = BITMAP_XMALLOC ();
 {
   struct dlist *d;
   bitmap already = BITMAP_XMALLOC ();
@@ -2429,7 +2350,7 @@ detect_spill_temps ()
        continue;
 
       /* A web with only defs and no uses can't be spilled.  Nevertheless
        continue;
 
       /* A web with only defs and no uses can't be spilled.  Nevertheless
-        it must get a color, as it takes away an register from all webs
+        it must get a color, as it takes away a register from all webs
         live at these defs.  So we make it a short web.  */
       if (web->num_uses == 0)
        web->spill_temp = 3;
         live at these defs.  So we make it a short web.  */
       if (web->num_uses == 0)
        web->spill_temp = 3;
@@ -2512,8 +2433,7 @@ detect_spill_temps ()
 /* Returns nonzero if the rtx MEM refers somehow to a stack location.  */
 
 int
 /* Returns nonzero if the rtx MEM refers somehow to a stack location.  */
 
 int
-memref_is_stack_slot (mem)
-     rtx mem;
+memref_is_stack_slot (rtx mem)
 {
   rtx ad = XEXP (mem, 0);
   rtx x;
 {
   rtx ad = XEXP (mem, 0);
   rtx x;
@@ -2530,14 +2450,13 @@ memref_is_stack_slot (mem)
 /* Returns nonzero, if rtx X somewhere contains any pseudo register.  */
 
 static int
 /* Returns nonzero, if rtx X somewhere contains any pseudo register.  */
 
 static int
-contains_pseudo (x)
-     rtx x;
+contains_pseudo (rtx x)
 {
   const char *fmt;
   int i;
   if (GET_CODE (x) == SUBREG)
     x = SUBREG_REG (x);
 {
   const char *fmt;
   int i;
   if (GET_CODE (x) == SUBREG)
     x = SUBREG_REG (x);
-  if (GET_CODE (x) == REG)
+  if (REG_P (x))
     {
       if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
         return 1;
     {
       if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
         return 1;
@@ -2569,8 +2488,7 @@ contains_pseudo (x)
 
 static GTY(()) rtx remat_test_insn;
 static int
 
 static GTY(()) rtx remat_test_insn;
 static int
-want_to_remat (x)
-     rtx x;
+want_to_remat (rtx x)
 {
   int num_clobbers = 0;
   int icode;
 {
   int num_clobbers = 0;
   int icode;
@@ -2608,7 +2526,7 @@ want_to_remat (x)
    and that value is simple enough, and want_to_remat() holds for it.  */
 
 static void
    and that value is simple enough, and want_to_remat() holds for it.  */
 
 static void
-detect_remat_webs ()
+detect_remat_webs (void)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
@@ -2653,11 +2571,11 @@ detect_remat_webs ()
                  oldwebs can't have their references changed.  The
                  incremental machinery barfs on that.  */
               || (!rtx_unstable_p (src) && !contains_pseudo (src))
                  oldwebs can't have their references changed.  The
                  incremental machinery barfs on that.  */
               || (!rtx_unstable_p (src) && !contains_pseudo (src))
-              /* Additionally also memrefs to stack-slots are usefull, when
+              /* Additionally also memrefs to stack-slots are useful, when
                  we created them ourself.  They might not have set their
                  unchanging flag set, but nevertheless they are stable across
                  the livetime in question.  */
                  we created them ourself.  They might not have set their
                  unchanging flag set, but nevertheless they are stable across
                  the livetime in question.  */
-              || (GET_CODE (src) == MEM
+              || (MEM_P (src)
                   && INSN_UID (insn) >= orig_max_uid
                   && memref_is_stack_slot (src)))
              /* And we must be able to construct an insn without
                   && INSN_UID (insn) >= orig_max_uid
                   && memref_is_stack_slot (src)))
              /* And we must be able to construct an insn without
@@ -2675,7 +2593,7 @@ detect_remat_webs ()
 /* Determine the spill costs of all webs.  */
 
 static void
 /* Determine the spill costs of all webs.  */
 
 static void
-determine_web_costs ()
+determine_web_costs (void)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
 {
   struct dlist *d;
   for (d = WEBS(INITIAL); d; d = d->next)
@@ -2732,14 +2650,14 @@ determine_web_costs ()
    which destroys the CFG.  (Somewhen we want to deal with that XXX)  */
 
 static void
    which destroys the CFG.  (Somewhen we want to deal with that XXX)  */
 
 static void
-detect_webs_set_in_cond_jump ()
+detect_webs_set_in_cond_jump (void)
 {
   basic_block bb;
   FOR_EACH_BB (bb)
 {
   basic_block bb;
   FOR_EACH_BB (bb)
-    if (GET_CODE (bb->end) == JUMP_INSN)
+    if (JUMP_P (BB_END (bb)))
       {
        struct df_link *link;
       {
        struct df_link *link;
-       for (link = DF_INSN_DEFS (df, bb->end); link; link = link->next)
+       for (link = DF_INSN_DEFS (df, BB_END (bb)); link; link = link->next)
          if (link->ref && DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER)
            {
              struct web *web = def2web[DF_REF_ID (link->ref)];
          if (link->ref && DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER)
            {
              struct web *web = def2web[DF_REF_ID (link->ref)];
@@ -2755,8 +2673,7 @@ detect_webs_set_in_cond_jump ()
    though.  */
 
 static void
    though.  */
 
 static void
-make_webs (df)
-     struct df *df;
+make_webs (struct df *df)
 {
   /* First build all the webs itself.  They are not related with
      others yet.  */
 {
   /* First build all the webs itself.  They are not related with
      others yet.  */
@@ -2774,8 +2691,7 @@ make_webs (df)
 /* Distribute moves to the corresponding webs.  */
 
 static void
 /* Distribute moves to the corresponding webs.  */
 
 static void
-moves_to_webs (df)
-     struct df *df;
+moves_to_webs (struct df *df)
 {
   struct df_link *link;
   struct move_list *ml;
 {
   struct df_link *link;
   struct move_list *ml;
@@ -2825,8 +2741,7 @@ moves_to_webs (df)
              for (; test && test->move != m; test = test->next);
              if (! test)
                {
              for (; test && test->move != m; test = test->next);
              if (! test)
                {
-                 newml = (struct move_list*)
-                   ra_alloc (sizeof (struct move_list));
+                 newml = ra_alloc (sizeof (struct move_list));
                  newml->move = m;
                  newml->next = m->source_web->moves;
                  m->source_web->moves = newml;
                  newml->move = m;
                  newml->next = m->source_web->moves;
                  m->source_web->moves = newml;
@@ -2835,8 +2750,7 @@ moves_to_webs (df)
              for (; test && test->move != m; test = test->next);
              if (! test)
                {
              for (; test && test->move != m; test = test->next);
              if (! test)
                {
-                 newml = (struct move_list*)
-                   ra_alloc (sizeof (struct move_list));
+                 newml = ra_alloc (sizeof (struct move_list));
                  newml->move = m;
                  newml->next = m->target_web->moves;
                  m->target_web->moves = newml;
                  newml->move = m;
                  newml->next = m->target_web->moves;
                  m->target_web->moves = newml;
@@ -2855,9 +2769,7 @@ moves_to_webs (df)
    and constrain the allocator too much.  */
 
 static void
    and constrain the allocator too much.  */
 
 static void
-handle_asm_insn (df, insn)
-     struct df *df;
-     rtx insn;
+handle_asm_insn (struct df *df, rtx insn)
 {
   const char *constraints[MAX_RECOG_OPERANDS];
   enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
 {
   const char *constraints[MAX_RECOG_OPERANDS];
   enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
@@ -2874,7 +2786,7 @@ handle_asm_insn (df, insn)
     for (i = 0; i < XVECLEN (pat, 0); i++)
       {
        rtx t = XVECEXP (pat, 0, i);
     for (i = 0; i < XVECLEN (pat, 0); i++)
       {
        rtx t = XVECEXP (pat, 0, i);
-       if (GET_CODE (t) == CLOBBER && GET_CODE (XEXP (t, 0)) == REG
+       if (GET_CODE (t) == CLOBBER && REG_P (XEXP (t, 0))
            && REGNO (XEXP (t, 0)) < FIRST_PSEUDO_REGISTER)
          SET_HARD_REG_BIT (clobbered, REGNO (XEXP (t, 0)));
       }
            && REGNO (XEXP (t, 0)) < FIRST_PSEUDO_REGISTER)
          SET_HARD_REG_BIT (clobbered, REGNO (XEXP (t, 0)));
       }
@@ -2899,7 +2811,7 @@ handle_asm_insn (df, insn)
             || GET_CODE (reg) == SIGN_EXTRACT
             || GET_CODE (reg) == STRICT_LOW_PART)
        reg = XEXP (reg, 0);
             || GET_CODE (reg) == SIGN_EXTRACT
             || GET_CODE (reg) == STRICT_LOW_PART)
        reg = XEXP (reg, 0);
-      if (GET_CODE (reg) != REG || REGNO (reg) < FIRST_PSEUDO_REGISTER)
+      if (!REG_P (reg) || REGNO (reg) < FIRST_PSEUDO_REGISTER)
        continue;
 
       /* Search the web corresponding to this operand.  We depend on
        continue;
 
       /* Search the web corresponding to this operand.  We depend on
@@ -2915,10 +2827,8 @@ handle_asm_insn (df, insn)
            link = link->next;
          if (!link || !link->ref)
            {
            link = link->next;
          if (!link || !link->ref)
            {
-             if (in_output)
-               in_output = 0;
-             else
-               abort ();
+             gcc_assert (in_output);
+             in_output = 0;
            }
          else
            break;
            }
          else
            break;
@@ -2933,13 +2843,13 @@ handle_asm_insn (df, insn)
       CLEAR_HARD_REG_SET (allowed);
       while (1)
        {
       CLEAR_HARD_REG_SET (allowed);
       while (1)
        {
-         char c = *p++;
+         char c = *p;
 
          if (c == '\0' || c == ',' || c == '#')
            {
              /* End of one alternative - mark the regs in the current
 
          if (c == '\0' || c == ',' || c == '#')
            {
              /* End of one alternative - mark the regs in the current
-              class, and reset the class.
-              */
+              class, and reset the class.  */
+             p++;
              IOR_HARD_REG_SET (allowed, reg_class_contents[cls]);
              if (cls != NO_REGS)
                nothing_allowed = 0;
              IOR_HARD_REG_SET (allowed, reg_class_contents[cls]);
              if (cls != NO_REGS)
                nothing_allowed = 0;
@@ -2977,8 +2887,10 @@ handle_asm_insn (df, insn)
              default:
                cls =
                  (int) reg_class_subunion[cls][(int)
              default:
                cls =
                  (int) reg_class_subunion[cls][(int)
-                                               REG_CLASS_FROM_LETTER (c)];
+                                               REG_CLASS_FROM_CONSTRAINT (c,
+                                                                          p)];
            }
            }
+         p += CONSTRAINT_LEN (c, p);
        }
 
       /* Now make conflicts between this web, and all hardregs, which
        }
 
       /* Now make conflicts between this web, and all hardregs, which
@@ -3010,7 +2922,7 @@ handle_asm_insn (df, insn)
              record_conflict (web, hardreg2web[c]);
 #endif
        }
              record_conflict (web, hardreg2web[c]);
 #endif
        }
-      if (rtl_dump_file)
+      if (dump_file)
        {
          int c;
          ra_debug_msg (DUMP_ASM, " ASM constrain Web %d conflicts with:", web->id);
        {
          int c;
          ra_debug_msg (DUMP_ASM, " ASM constrain Web %d conflicts with:", web->id);
@@ -3027,8 +2939,7 @@ handle_asm_insn (df, insn)
    and conflicts.  */
 
 void
    and conflicts.  */
 
 void
-build_i_graph (df)
-     struct df *df;
+build_i_graph (struct df *df)
 {
   rtx insn;
 
 {
   rtx insn;
 
@@ -3061,8 +2972,7 @@ build_i_graph (df)
    defs and uses.  */
 
 void
    defs and uses.  */
 
 void
-ra_build_realloc (df)
-     struct df *df;
+ra_build_realloc (struct df *df)
 {
   struct web_part *last_web_parts = web_parts;
   struct web **last_def2web = def2web;
 {
   struct web_part *last_web_parts = web_parts;
   struct web **last_def2web = def2web;
@@ -3071,10 +2981,8 @@ ra_build_realloc (df)
   unsigned int i;
   struct dlist *d;
   move_handled = sbitmap_alloc (get_max_uid () );
   unsigned int i;
   struct dlist *d;
   move_handled = sbitmap_alloc (get_max_uid () );
-  web_parts = (struct web_part *) xcalloc (df->def_id + df->use_id,
-                                          sizeof web_parts[0]);
-  def2web = (struct web **) xcalloc (df->def_id + df->use_id,
-                                    sizeof def2web[0]);
+  web_parts = xcalloc (df->def_id + df->use_id, sizeof web_parts[0]);
+  def2web = xcalloc (df->def_id + df->use_id, sizeof def2web[0]);
   use2web = &def2web[df->def_id];
   live_over_abnormal = sbitmap_alloc (df->use_id);
   sbitmap_zero (live_over_abnormal);
   use2web = &def2web[df->def_id];
   live_over_abnormal = sbitmap_alloc (df->use_id);
   sbitmap_zero (live_over_abnormal);
@@ -3164,14 +3072,12 @@ ra_build_realloc (df)
   if (!last_max_uid)
     {
       /* Setup copy cache, for copy_insn_p ().  */
   if (!last_max_uid)
     {
       /* Setup copy cache, for copy_insn_p ().  */
-      copy_cache = (struct copy_p_cache *)
-       xcalloc (get_max_uid (), sizeof (copy_cache[0]));
+      copy_cache = xcalloc (get_max_uid (), sizeof (copy_cache[0]));
       init_bb_info ();
     }
   else
     {
       init_bb_info ();
     }
   else
     {
-      copy_cache = (struct copy_p_cache *)
-       xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
+      copy_cache = xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
       memset (&copy_cache[last_max_uid], 0,
              (get_max_uid () - last_max_uid) * sizeof (copy_cache[0]));
     }
       memset (&copy_cache[last_max_uid], 0,
              (get_max_uid () - last_max_uid) * sizeof (copy_cache[0]));
     }
@@ -3180,7 +3086,7 @@ ra_build_realloc (df)
 /* Free up/clear some memory, only needed for one pass.  */
 
 void
 /* Free up/clear some memory, only needed for one pass.  */
 
 void
-ra_build_free ()
+ra_build_free (void)
 {
   struct dlist *d;
   unsigned int i;
 {
   struct dlist *d;
   unsigned int i;
@@ -3190,11 +3096,9 @@ ra_build_free ()
   for (i = 0; i < num_webs; i++)
     {
       struct web *web = ID2WEB (i);
   for (i = 0; i < num_webs; i++)
     {
       struct web *web = ID2WEB (i);
-      if (!web)
-       abort ();
-      if (i >= num_webs - num_subwebs
-         && (web->conflict_list || web->orig_conflict_list))
-       abort ();
+      gcc_assert (web);
+      gcc_assert (i < num_webs - num_subwebs
+                 || (!web->conflict_list && !web->orig_conflict_list));
       web->moves = NULL;
     }
   /* All webs in the free list have no defs or uses anymore.  */
       web->moves = NULL;
     }
   /* All webs in the free list have no defs or uses anymore.  */
@@ -3240,8 +3144,7 @@ ra_build_free ()
 /* Free all memory for the interference graph structures.  */
 
 void
 /* Free all memory for the interference graph structures.  */
 
 void
-ra_build_free_all (df)
-     struct df *df;
+ra_build_free_all (struct df *df)
 {
   unsigned int i;
 
 {
   unsigned int i;