aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-07-31 20:37:40 -0400
committerJason Merrill <jason@gcc.gnu.org>2003-07-31 20:37:40 -0400
commit40209195282377a7254ebbd80d5f55595d92d458 (patch)
tree79a4e2f422d448416597a92bb623f91759bfe6b8 /gcc
parent2598550fa6d3583ce066a9aaf5abfa4acd186077 (diff)
downloadgcc-40209195282377a7254ebbd80d5f55595d92d458.zip
gcc-40209195282377a7254ebbd80d5f55595d92d458.tar.gz
gcc-40209195282377a7254ebbd80d5f55595d92d458.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/Makefile.in28
-rw-r--r--gcc/expr.c5
-rw-r--r--gcc/stmt.c56
-rw-r--r--gcc/tree.h5
5 files changed, 72 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7590ddd..a4b2a02 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c32f0dd..afe1b5a 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 f95678f..47c4f92 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 a4900ec..8166187 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 [<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;
}
diff --git a/gcc/tree.h b/gcc/tree.h
index e44af15..c8a71e5 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);