From: Jason Merrill Date: Fri, 1 Aug 2003 00:37:40 +0000 (-0400) Subject: Makefile.in (bubblestrap): Don't require a previous full bootstrap. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40209195282377a7254ebbd80d5f55595d92d458;p=gcc.git Makefile.in (bubblestrap): Don't require a previous full bootstrap. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7590ddd2444..a4b2a0252ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2003-07-31 Jason Merrill + + * 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 * fold-const.c (fold ): Optimize both x*pow(x,c) and diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c32f0dd431f..afe1b5ab9e6 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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 \ diff --git a/gcc/expr.c b/gcc/expr.c index f95678f9dd1..47c4f92adac 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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; } -/* 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) diff --git a/gcc/stmt.c b/gcc/stmt.c index a4900ec0822..81661873c2c 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1992,13 +1992,14 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs) { char *buffer; char *p; + const char *c; tree t; /* Substitute [] 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; } diff --git a/gcc/tree.h b/gcc/tree.h index e44af15a877..c8a71e53796 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -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);