OSDN Git Service

* reload.c (find_reloads): Reorganize if seqeunce to switch.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Mar 2004 21:31:43 +0000 (21:31 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Mar 2004 21:31:43 +0000 (21:31 +0000)
* cfgrtl.c (rtl_redirect_edge_and_branch):  Set the source BB as dirty.
(cfglayout_redirect_edge_and_branch):  Set the source BB as dirty.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78936 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfgrtl.c
gcc/reload.c

index 16fa29c..f126b1c 100644 (file)
@@ -1,3 +1,10 @@
+2004-03-04  Jan Hubicka  <jh@suse.cz>
+
+       * reload.c (find_reloads): Reorganize if seqeunce to switch.
+
+       * cfgrtl.c (rtl_redirect_edge_and_branch):  Set the source BB as dirty.
+       (cfglayout_redirect_edge_and_branch):  Set the source BB as dirty.
+
 2004-03-04  Steve Ellcey  <sje@cup.hp.com>
 
        * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm.
index 35d7c9e..3363a2d 100644 (file)
@@ -933,6 +933,8 @@ redirect_branch_edge (edge e, basic_block target)
 static bool
 rtl_redirect_edge_and_branch (edge e, basic_block target)
 {
+  basic_block src = e->src;
+
   if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
     return false;
 
@@ -940,11 +942,15 @@ rtl_redirect_edge_and_branch (edge e, basic_block target)
     return true;
 
   if (try_redirect_by_replacing_jump (e, target, false))
-    return true;
+    {
+      src->flags |= BB_DIRTY;
+      return true;
+    }
 
   if (!redirect_branch_edge (e, target))
     return false;
 
+  src->flags |= BB_DIRTY;
   return true;
 }
 
@@ -2379,7 +2385,10 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
 
   if (e->src != ENTRY_BLOCK_PTR
       && try_redirect_by_replacing_jump (e, dest, true))
-    return true;
+    {
+      src->flags |= BB_DIRTY;
+      return true;
+    }
 
   if (e->src == ENTRY_BLOCK_PTR
       && (e->flags & EDGE_FALLTHRU) && !(e->flags & EDGE_COMPLEX))
@@ -2388,6 +2397,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
        fprintf (dump_file, "Redirecting entry edge from bb %i to %i\n",
                 e->src->index, dest->index);
 
+      e->src->flags |= BB_DIRTY;
       redirect_edge_succ (e, dest);
       return true;
     }
@@ -2411,6 +2421,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
          if (!redirect_branch_edge (e, dest))
            abort ();
          e->flags |= EDGE_FALLTHRU;
+          e->src->flags |= BB_DIRTY;
          return true;
        }
       /* In case we are redirecting fallthru edge to the branch edge
@@ -2438,6 +2449,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
   if (simplejump_p (BB_END (src)))
     abort ();
 
+  src->flags |= BB_DIRTY;
   return ret;
 }
 
index d3cdaa8..f1682f7 100644 (file)
@@ -2610,62 +2610,71 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
       while ((c = *p))
        {
          p += CONSTRAINT_LEN (c, p);
-         if (c == '=')
-           modified[i] = RELOAD_WRITE;
-         else if (c == '+')
-           modified[i] = RELOAD_READ_WRITE;
-         else if (c == '%')
+         switch (c)
            {
-             /* The last operand should not be marked commutative.  */
-             if (i == noperands - 1)
-               abort ();
-
-             /* We currently only support one commutative pair of
-                operands.  Some existing asm code currently uses more
-                than one pair.  Previously, that would usually work,
-                but sometimes it would crash the compiler.  We
-                continue supporting that case as well as we can by
-                silently ignoring all but the first pair.  In the
-                future we may handle it correctly.  */
-             if (commutative < 0)
-               commutative = i;
-             else if (!this_insn_is_asm)
-               abort ();
-           }
-         else if (ISDIGIT (c))
-           {
-             c = strtoul (p - 1, &p, 10);
+           case '=':
+             modified[i] = RELOAD_WRITE;
+             break;
+           case '+':
+             modified[i] = RELOAD_READ_WRITE;
+             break;
+           case '%':
+             {
+               /* The last operand should not be marked commutative.  */
+               if (i == noperands - 1)
+                 abort ();
 
-             operands_match[c][i]
-               = operands_match_p (recog_data.operand[c],
-                                   recog_data.operand[i]);
+               /* We currently only support one commutative pair of
+                  operands.  Some existing asm code currently uses more
+                  than one pair.  Previously, that would usually work,
+                  but sometimes it would crash the compiler.  We
+                  continue supporting that case as well as we can by
+                  silently ignoring all but the first pair.  In the
+                  future we may handle it correctly.  */
+               if (commutative < 0)
+                 commutative = i;
+               else if (!this_insn_is_asm)
+                 abort ();
+             }
+             break;
+           /* Use of ISDIGIT is tempting here, but it may get expensive because
+              of locale support we don't want.  */
+           case '0': case '1': case '2': case '3': case '4':
+           case '5': case '6': case '7': case '8': case '9':
+             {
+               c = strtoul (p - 1, &p, 10);
 
-             /* An operand may not match itself.  */
-             if (c == i)
-               abort ();
+               operands_match[c][i]
+                 = operands_match_p (recog_data.operand[c],
+                                     recog_data.operand[i]);
 
-             /* If C can be commuted with C+1, and C might need to match I,
-                then C+1 might also need to match I.  */
-             if (commutative >= 0)
-               {
-                 if (c == commutative || c == commutative + 1)
-                   {
-                     int other = c + (c == commutative ? 1 : -1);
-                     operands_match[other][i]
-                       = operands_match_p (recog_data.operand[other],
-                                           recog_data.operand[i]);
-                   }
-                 if (i == commutative || i == commutative + 1)
-                   {
-                     int other = i + (i == commutative ? 1 : -1);
-                     operands_match[c][other]
-                       = operands_match_p (recog_data.operand[c],
-                                           recog_data.operand[other]);
-                   }
-                 /* Note that C is supposed to be less than I.
-                    No need to consider altering both C and I because in
-                    that case we would alter one into the other.  */
-               }
+               /* An operand may not match itself.  */
+               if (c == i)
+                 abort ();
+
+               /* If C can be commuted with C+1, and C might need to match I,
+                  then C+1 might also need to match I.  */
+               if (commutative >= 0)
+                 {
+                   if (c == commutative || c == commutative + 1)
+                     {
+                       int other = c + (c == commutative ? 1 : -1);
+                       operands_match[other][i]
+                         = operands_match_p (recog_data.operand[other],
+                                             recog_data.operand[i]);
+                     }
+                   if (i == commutative || i == commutative + 1)
+                     {
+                       int other = i + (i == commutative ? 1 : -1);
+                       operands_match[c][other]
+                         = operands_match_p (recog_data.operand[c],
+                                             recog_data.operand[other]);
+                     }
+                   /* Note that C is supposed to be less than I.
+                      No need to consider altering both C and I because in
+                      that case we would alter one into the other.  */
+                 }
+             }
            }
        }
     }