OSDN Git Service

2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / loop-doloop.c
index 448bb72..293b3ae 100644 (file)
@@ -1,5 +1,6 @@
 /* Perform doloop optimizations
-   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
+   Inc.
    Based on code by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz)
 
 This file is part of GCC.
@@ -320,9 +321,8 @@ add_test (rtx cond, edge *e, basic_block dest)
   JUMP_LABEL (jump) = label;
 
   /* The jump is supposed to handle an unlikely special case.  */
-  REG_NOTES (jump)
-         = gen_rtx_EXPR_LIST (REG_BR_PROB,
-                              const0_rtx, REG_NOTES (jump));
+  add_reg_note (jump, REG_BR_PROB, const0_rtx);
+
   LABEL_NUSES (label)++;
 
   make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
@@ -362,7 +362,7 @@ doloop_modify (struct loop *loop, struct niter_desc *desc,
       fputs (" iterations).\n", dump_file);
     }
 
-  /* Get the probabilty of the original branch. If it exists we would
+  /* Get the probability of the original branch. If it exists we would
      need to update REG_BR_PROB of the new jump_insn.  */
   true_prob_val = find_reg_note (jump_insn, REG_BR_PROB, NULL_RTX);
 
@@ -517,18 +517,14 @@ doloop_modify (struct loop *loop, struct niter_desc *desc,
   /* Add a REG_NONNEG note if the actual or estimated maximum number
      of iterations is non-negative.  */
   if (nonneg)
-    {
-      REG_NOTES (jump_insn)
-       = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX, REG_NOTES (jump_insn));
-    }
+    add_reg_note (jump_insn, REG_NONNEG, NULL_RTX);
+
   /* Update the REG_BR_PROB note.  */
   if (true_prob_val)
     {
       /* Seems safer to use the branch probability.  */
-      REG_NOTES (jump_insn) =
-        gen_rtx_EXPR_LIST (REG_BR_PROB,
-                           GEN_INT (desc->in_edge->probability),
-                           REG_NOTES (jump_insn));
+      add_reg_note (jump_insn, REG_BR_PROB, 
+                   GEN_INT (desc->in_edge->probability));
     }
 }