OSDN Git Service

2004-11-12 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / ra-build.c
index 4f0eac0..20254ea 100644 (file)
@@ -228,8 +228,7 @@ copy_insn_p (rtx insn, rtx *source, rtx *target)
   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)
@@ -259,13 +258,13 @@ copy_insn_p (rtx insn, rtx *source, rtx *target)
      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);
-  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);
@@ -504,8 +503,7 @@ union_web_part_roots (struct web_part *r1, struct web_part *r2)
            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;
                }
@@ -541,29 +539,30 @@ remember_move (rtx insn)
   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));
-      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).  */
-      if (GET_CODE (s) == REG && GET_CODE (d) == REG)
+      if (REG_P (s) && REG_P (d))
        {
          struct move *m = ra_calloc (sizeof (struct move));
          struct move_list *ml;
@@ -669,7 +668,7 @@ defuse_overlap_p_1 (rtx def, struct curr_use *use)
          return (old_u != use->undefined) ? 4 : -1;
        }
       default:
-        abort ();
+        gcc_unreachable ();
     }
 }
 
@@ -711,7 +710,7 @@ live_out_1 (struct df *df ATTRIBUTE_UNUSED, struct curr_use *use, rtx insn)
 
       /* 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);
@@ -821,8 +820,7 @@ live_out_1 (struct df *df ATTRIBUTE_UNUSED, struct curr_use *use, rtx insn)
        {
          /* 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;
@@ -925,6 +923,7 @@ live_in (struct df *df, struct curr_use *use, rtx insn)
      are allowed.  */
   while (1)
     {
+      unsigned int i;
       int uid = INSN_UID (insn);
       basic_block bb = BLOCK_FOR_INSN (insn);
       number_seen[uid]++;
@@ -941,7 +940,7 @@ live_in (struct df *df, struct curr_use *use, rtx insn)
          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
@@ -953,8 +952,9 @@ live_in (struct df *df, struct curr_use *use, rtx insn)
          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);
@@ -1022,12 +1022,12 @@ livethrough_conflicts_bb (basic_block bb)
   struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
   rtx insn;
   bitmap all_defs;
-  int first, use_id;
+  unsigned use_id;
   unsigned int deaths = 0;
   unsigned int contains_call = 0;
 
   /* If there are no deferred uses, just return.  */
-  if ((first = bitmap_first_set_bit (info->live_throughout)) < 0)
+  if (bitmap_empty_p (info->live_throughout))
     return;
 
   /* First collect the IDs of all defs, count the number of death
@@ -1045,7 +1045,7 @@ livethrough_conflicts_bb (basic_block bb)
            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;
        }
       if (insn == BB_END (bb))
@@ -1054,18 +1054,24 @@ livethrough_conflicts_bb (basic_block bb)
 
   /* 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, 0, 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);
 }
@@ -1204,8 +1210,7 @@ prune_hardregs_for_mode (HARD_REG_SET *s, enum machine_mode mode)
 static void
 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;
@@ -1270,8 +1275,7 @@ init_one_web_common (struct web *web, rtx reg)
 #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);
 }
@@ -1322,10 +1326,8 @@ reinit_one_web (struct web *web, rtx reg)
   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
@@ -1335,8 +1337,7 @@ static struct web *
 add_subweb (struct web *web, rtx reg)
 {
   struct web *w;
-  if (GET_CODE (reg) != SUBREG)
-    abort ();
+  gcc_assert (GET_CODE (reg) == SUBREG);
   w = xmalloc (sizeof (struct web));
   /* Copy most content from parent-web.  */
   *w = *web;
@@ -1374,8 +1375,7 @@ add_subweb_2 (struct web *web, unsigned int  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);
-  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;
@@ -1394,8 +1394,7 @@ init_web_parts (struct df *df)
     {
       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)
@@ -1412,9 +1411,8 @@ init_web_parts (struct df *df)
     {
       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++;
@@ -1462,8 +1460,8 @@ static void
 copy_conflict_list (struct web *web)
 {
   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)
     {
@@ -1570,8 +1568,7 @@ record_conflict (struct web *web1, struct web *web2)
   /* 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])
@@ -1661,32 +1658,27 @@ compare_and_free_webs (struct web_link **link)
     {
       struct web *web1 = wl->web;
       struct web *web2 = ID2WEB (web1->id);
-      if (web1->regno != web2->regno
-         || 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))
-         /* Similarly, if the framepointer was unreferenced originally
-            but we added spills, these fields may not match.  */
-         || (web1->type != PRECOLORED
-               && web1->crosses_call != web2->crosses_call)
-         || (web1->type != PRECOLORED
-              && web1->live_over_abnormal != web2->live_over_abnormal))
-       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;
+
+         /* 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++)
-           if (web1->defs[i] != web2->defs[i])
-             abort ();
+           gcc_assert (web1->defs[i] == web2->defs[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)
        {
@@ -1731,8 +1723,8 @@ init_webs_defs_uses (void)
            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);
     }
 }
 
@@ -1832,11 +1824,13 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
          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.
@@ -1859,8 +1853,8 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
            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
@@ -1882,8 +1876,7 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
 
       /* 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)
@@ -1892,8 +1885,7 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
          if (!subweb)
            {
              subweb = add_subweb (web, reg);
-             if (web->old_web)
-               abort ();
+             gcc_assert (!web->old_web);
            }
        }
       else
@@ -1915,14 +1907,9 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
            {
              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++;
@@ -1932,15 +1919,11 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
          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++;
@@ -1950,8 +1933,7 @@ parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
     }
 
   /* 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;
 }
@@ -1999,8 +1981,7 @@ parts_to_webs (struct df *df)
       struct web *web;
       if (wp->uplink || !wp->ref)
        {
-         if (wp->sub_conflicts)
-           abort ();
+         gcc_assert (!wp->sub_conflicts);
          continue;
        }
       web = def2web[i];
@@ -2085,8 +2066,7 @@ reset_conflicts (void)
          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)
@@ -2095,15 +2075,13 @@ reset_conflicts (void)
          /* 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.  */
-         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)
            {
@@ -2151,8 +2129,7 @@ check_conflict_numbers (void)
       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
@@ -2174,9 +2151,7 @@ static void
 conflicts_between_webs (struct df *df)
 {
   unsigned int i;
-#ifdef STACK_REGS
   struct dlist *d;
-#endif
   bitmap ignore_defs = BITMAP_XMALLOC ();
   unsigned int have_ignored;
   unsigned int *pass_cache = xcalloc (num_webs, sizeof (int));
@@ -2195,7 +2170,7 @@ conflicts_between_webs (struct df *df)
   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
@@ -2218,11 +2193,12 @@ conflicts_between_webs (struct df *df)
       for (; cl; cl = cl->next)
         if (cl->conflicts)
          {
-           int j;
+           unsigned j;
            struct web *web1 = find_subweb_2 (supweb1, cl->size_word);
+           bitmap_iterator bi;
+
            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
@@ -2234,8 +2210,7 @@ conflicts_between_webs (struct df *df)
            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;
@@ -2244,25 +2219,31 @@ conflicts_between_webs (struct df *df)
                    pass_cache[id2] = pass;
                    record_conflict (web1, web2);
                  }
-             });
+             }
          }
     }
 
   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;
+
+      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]);
-    }
 #endif
+    }
 }
 
 /* Remember that a web was spilled, and change some characteristics
@@ -2310,8 +2291,7 @@ remember_web_was_spilled (struct web *web)
     AND_COMPL_HARD_REG_SET (web->usable_regs, invalid_mode_change_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.  */
@@ -2339,8 +2319,7 @@ remember_web_was_spilled (struct web *web)
   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;
 }
@@ -2476,7 +2455,7 @@ contains_pseudo (rtx x)
   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;
@@ -2595,7 +2574,7 @@ detect_remat_webs (void)
                  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
@@ -2674,7 +2653,7 @@ detect_webs_set_in_cond_jump (void)
 {
   basic_block bb;
   FOR_EACH_BB (bb)
-    if (GET_CODE (BB_END (bb)) == JUMP_INSN)
+    if (JUMP_P (BB_END (bb)))
       {
        struct df_link *link;
        for (link = DF_INSN_DEFS (df, BB_END (bb)); link; link = link->next)
@@ -2806,7 +2785,7 @@ handle_asm_insn (struct df *df, rtx insn)
     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)));
       }
@@ -2831,7 +2810,7 @@ handle_asm_insn (struct df *df, rtx insn)
             || 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
@@ -2847,10 +2826,8 @@ handle_asm_insn (struct df *df, rtx insn)
            link = link->next;
          if (!link || !link->ref)
            {
-             if (in_output)
-               in_output = 0;
-             else
-               abort ();
+             gcc_assert (in_output);
+             in_output = 0;
            }
          else
            break;
@@ -3118,11 +3095,9 @@ ra_build_free (void)
   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.  */