Makefile.in (bubblestrap): Don't require a previous full bootstrap.
authorJason Merrill <jason@redhat.com>
Fri, 1 Aug 2003 00:37:40 +0000 (20:37 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 1 Aug 2003 00:37:40 +0000 (20:37 -0400)
        * Makefile.in (bubblestrap): Don't require a previous full
        bootstrap.

        * expr.c (mostly_zeros_p): No longer static.
        * tree.h: Declare it.
        * stmt.c (resolve_asm_operand_names): Don't copy the pattern
        unless we need to do substitutions.

From-SVN: r70031

gcc/ChangeLog
gcc/Makefile.in
gcc/expr.c
gcc/stmt.c
gcc/tree.h

index 7590ddd24441e04a026bbf47edcf2b66d6753d34..a4b2a0252ffea690eaf3f0a3aa8a36b556c47d2a 100644 (file)
@@ -1,3 +1,13 @@
+2003-07-31  Jason Merrill  <jason@redhat.com>
+
+       * Makefile.in (bubblestrap): Don't require a previous full
+       bootstrap.
+
+       * expr.c (mostly_zeros_p): No longer static.
+       * tree.h: Declare it.
+       * stmt.c (resolve_asm_operand_names): Don't copy the pattern
+       unless we need to do substitutions.
+
 2003-07-31  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (fold <MULT_EXPR>): Optimize both x*pow(x,c) and
index c32f0dd431f1dc86be49765aadbbb7da7b359862..afe1b5ab9e6161041291500aca1f77c3a66b951e 100644 (file)
@@ -3647,18 +3647,26 @@ restageprofile: unstageprofile
 restagefeedback: unstagefeedback
        $(MAKE) LANGUAGES="$(LANGUAGES)" stagefeedback_build
 
+# Bubble up a bugfix through all the stages.  Primarily useful for fixing
+# bugs that cause the compiler to crash while building stage 2.
 bubblestrap:
-       if test -f stage3_build; then true; else \
-         echo; echo You must \"make bootstrap\" first.; \
-         exit 1; \
+       if test -f stage_last; then \
+         LAST=`cat stage_last|sed -e 's/_build//'`; \
+         if test "$$LAST" != "stage1"; then \
+           $(MAKE) $$LAST; \
+           $(STAMP) $${LAST}_copy; \
+         fi; \
+       fi
+       if test -f stage1_copy; then $(MAKE) unstage1; fi
+       $(MAKE) LANGUAGES="$(LANGUAGES)" stage1_copy
+       if test -f stage2_copy; then $(MAKE) unstage2; fi
+       $(MAKE) LANGUAGES="$(LANGUAGES)" stage2_copy
+       if test -f stage3_copy; then $(MAKE) unstage3; fi
+       $(MAKE) LANGUAGES="$(LANGUAGES)" stage3_build
+       if test -f stage4_copy; then \
+         $(MAKE) stage3_copy; $(MAKE) unstage4; \
+         $(MAKE) LANGUAGES="$(LANGUAGES)" stage4_build || exit 1; \
        fi
-       for i in stage3 \
-               unstage1 stage1_build stage1_copy \
-               unstage2 stage2_build stage2_copy \
-               unstage3 stage3_build ; \
-       do \
-         $(MAKE) LANGUAGES="$(LANGUAGES)" $$i || exit 1 ; \
-       done
 
 quickstrap:
        if test -f stage_last ; then \
index f95678f9dd12fa597d14e45cbc373f0f27bed429..47c4f92adac99c21974f84c5e59686973f3c2614 100644 (file)
@@ -151,7 +151,6 @@ static tree clear_storage_libcall_fn (int);
 static rtx compress_float_constant (rtx, rtx);
 static rtx get_subtarget (rtx);
 static int is_zeros_p (tree);
-static int mostly_zeros_p (tree);
 static void store_constructor_field (rtx, unsigned HOST_WIDE_INT,
                                     HOST_WIDE_INT, enum machine_mode,
                                     tree, tree, int, int);
@@ -4766,7 +4765,7 @@ store_expr (tree exp, rtx target, int want_value)
     return target;
 }
 \f
-/* Return 1 if EXP just contains zeros.  */
+/* Return 1 if EXP just contains zeros.  FIXME merge with initializer_zerop.  */
 
 static int
 is_zeros_p (tree exp)
@@ -4815,7 +4814,7 @@ is_zeros_p (tree exp)
 
 /* Return 1 if EXP contains mostly (3/4)  zeros.  */
 
-static int
+int
 mostly_zeros_p (tree exp)
 {
   if (TREE_CODE (exp) == CONSTRUCTOR)
index a4900ec0822932dd8b33a533f7f1a30e62cdd566..81661873c2c92a6610eed84024728260fa88c900 100644 (file)
@@ -1992,13 +1992,14 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
 {
   char *buffer;
   char *p;
+  const char *c;
   tree t;
 
   /* Substitute [<name>] in input constraint strings.  There should be no
      named operands in output constraints.  */
   for (t = inputs; t ; t = TREE_CHAIN (t))
     {
-      const char *c = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
+      c = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
       if (strchr (c, '[') != NULL)
        {
          p = buffer = xstrdup (c);
@@ -2010,31 +2011,48 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
        }
     }
 
-  if (strchr (TREE_STRING_POINTER (string), '[') == NULL)
-    return string;
-
-  /* Assume that we will not need extra space to perform the substitution.
-     This because we get to remove '[' and ']', which means we cannot have
-     a problem until we have more than 999 operands.  */
-
-  p = buffer = xstrdup (TREE_STRING_POINTER (string));
-  while ((p = strchr (p, '%')) != NULL)
+  /* Now check for any needed substitutions in the template.  */
+  c = TREE_STRING_POINTER (string);
+  while ((c = strchr (c, '%')) != NULL)
     {
-      if (p[1] == '[')
-       p += 1;
-      else if (ISALPHA (p[1]) && p[2] == '[')
-       p += 2;
+      if (c[1] == '[')
+       break;
+      else if (ISALPHA (c[1]) && c[2] == '[')
+       break;
       else
        {
-         p += 1;
+         c += 1;
          continue;
        }
-
-      p = resolve_operand_name_1 (p, outputs, inputs);
     }
 
-  string = build_string (strlen (buffer), buffer);
-  free (buffer);
+  if (c)
+    {
+      /* OK, we need to make a copy so we can perform the substitutions.
+        Assume that we will not need extra space--we get to remove '['
+        and ']', which means we cannot have a problem until we have more
+        than 999 operands.  */
+      buffer = xstrdup (TREE_STRING_POINTER (string));
+      p = buffer + (c - TREE_STRING_POINTER (string));
+      
+      while ((p = strchr (p, '%')) != NULL)
+       {
+         if (p[1] == '[')
+           p += 1;
+         else if (ISALPHA (p[1]) && p[2] == '[')
+           p += 2;
+         else
+           {
+             p += 1;
+             continue;
+           }
+
+         p = resolve_operand_name_1 (p, outputs, inputs);
+       }
+
+      string = build_string (strlen (buffer), buffer);
+      free (buffer);
+    }
 
   return string;
 }
index e44af15a877e371bf3cd94aa27c2d3d84b4f7f96..c8a71e53796d1110b6b07faa551716c71bb80946 100644 (file)
@@ -2445,6 +2445,11 @@ extern int fields_length (tree);
 
 extern bool initializer_zerop (tree);
 
+/* Given an initializer INIT, return TRUE if INIT is at least 3/4 zeros.
+   Otherwise return FALSE.  */
+
+extern int mostly_zeros_p (tree);
+
 /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */
 
 extern int integer_zerop (tree);