This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Resurrect toplevel bootstrap
The targets in the first make command have changed several times, but
there's always been something that didn't require me to know the list
of all the things that had to be built first. I'd hate to lose that.
Ok, so I'll ensure there's a way to do so before toplevel bootstrap
becomes the default...
In the meanwhile, here's the toplevel bootstrap patch. It includes
three-staging of libiberty and friends; I've not yet tried it on a
combined tree, but the actual logic is easy enough that I am quite
confident that it works.
There are practically no changes in the Makefile if --disable-bootstrap
(the default) is specified. There are only a few additional rules that
I left there to limit the number of conditionals.
The changes in the patch are twofold: first we have of course to loop
over all bootstrapped modules; and second, we have to change for any
configure-stageXXX-* or all-stageXXX-* file where before we'd look for
configure-stageXXX-gcc or all-stageXXX-gcc.
To do now: Add an all-prebootstrap-like target for Zack :-), and make it
safe for parallel makes, using some kind of serialization dependency
between bootstrapping and the post-bootstrap stage. Then, enable build
modules when bootstrapping (but not libiberty).
Old- and new-style bootstrapped/regtested with gcc HEAD. Ok for gcc and
src?
Paolo
2004-08-10 Paolo Bonzini <bonzini@gnu.org>
* dojump.c (do_jump) <COND_EXPR, EQ_EXPR, NE_EXPR,
TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, COMPOUND_EXPR>:
Abort on gimplified cases.
Index: dojump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dojump.c,v
retrieving revision 1.26
diff -u -r1.26 dojump.c
--- dojump.c 28 Jul 2004 23:44:43 -0000 1.26
+++ dojump.c 10 Aug 2004 08:46:14 -0000
@@ -208,19 +208,6 @@
do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label);
break;
-#if 0
- /* This is never less insns than evaluating the PLUS_EXPR followed by
- a test and can be longer if the test is eliminated. */
- case PLUS_EXPR:
- /* Reduce to minus. */
- exp = build2 (MINUS_EXPR, TREE_TYPE (exp),
- TREE_OPERAND (exp, 0),
- fold (build1 (NEGATE_EXPR,
- TREE_TYPE (TREE_OPERAND (exp, 1)),
- TREE_OPERAND (exp, 1))));
- /* Process as MINUS. */
-#endif
-
case MINUS_EXPR:
/* Nonzero iff operands of minus differ. */
do_compare_and_jump (build2 (NE_EXPR, TREE_TYPE (exp),
@@ -281,28 +268,11 @@
break;
case TRUTH_ANDIF_EXPR:
- if (if_false_label == 0)
- if_false_label = drop_through_label = gen_label_rtx ();
- do_jump (TREE_OPERAND (exp, 0), if_false_label, NULL_RTX);
- do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label);
- break;
-
case TRUTH_ORIF_EXPR:
- if (if_true_label == 0)
- if_true_label = drop_through_label = gen_label_rtx ();
- do_jump (TREE_OPERAND (exp, 0), NULL_RTX, if_true_label);
- do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label);
- break;
-
case COMPOUND_EXPR:
- push_temp_slots ();
- expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
- preserve_temp_slots (NULL_RTX);
- free_temp_slots ();
- pop_temp_slots ();
- do_pending_stack_adjust ();
- do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label);
- break;
+ case COND_EXPR:
+ /* Lowered by gimplify.c. */
+ abort ();
case COMPONENT_REF:
case BIT_FIELD_REF:
@@ -334,70 +304,16 @@
goto normal;
}
- case COND_EXPR:
- /* Do (a ? 1 : 0) and (a ? 0 : 1) as special cases. */
- if (integer_onep (TREE_OPERAND (exp, 1))
- && integer_zerop (TREE_OPERAND (exp, 2)))
- do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label);
-
- else if (integer_zerop (TREE_OPERAND (exp, 1))
- && integer_onep (TREE_OPERAND (exp, 2)))
- do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label);
-
- else
- {
- rtx label1 = gen_label_rtx ();
- drop_through_label = gen_label_rtx ();
-
- do_jump (TREE_OPERAND (exp, 0), label1, NULL_RTX);
-
- /* Now the THEN-expression. */
- do_jump (TREE_OPERAND (exp, 1),
- if_false_label ? if_false_label : drop_through_label,
- if_true_label ? if_true_label : drop_through_label);
- /* In case the do_jump just above never jumps. */
- do_pending_stack_adjust ();
- emit_label (label1);
-
- /* Now the ELSE-expression. */
- do_jump (TREE_OPERAND (exp, 2),
- if_false_label ? if_false_label : drop_through_label,
- if_true_label ? if_true_label : drop_through_label);
- }
- break;
-
case EQ_EXPR:
{
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
|| GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
- {
- tree exp0 = save_expr (TREE_OPERAND (exp, 0));
- tree exp1 = save_expr (TREE_OPERAND (exp, 1));
- do_jump
- (fold
- (build2 (TRUTH_ANDIF_EXPR, TREE_TYPE (exp),
- fold (build2 (EQ_EXPR, TREE_TYPE (exp),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- exp0)),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- exp1)))),
- fold (build2 (EQ_EXPR, TREE_TYPE (exp),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- exp0)),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- exp1)))))),
- if_false_label, if_true_label);
- }
-
+ /* Lowered by gimplify.c. */
+ abort ();
else if (integer_zerop (TREE_OPERAND (exp, 1)))
do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label);
-
else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
&& !can_compare_p (EQ, TYPE_MODE (inner_type), ccp_jump))
do_jump_by_parts_equality (exp, if_false_label, if_true_label);
@@ -412,32 +327,10 @@
if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
|| GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
- {
- tree exp0 = save_expr (TREE_OPERAND (exp, 0));
- tree exp1 = save_expr (TREE_OPERAND (exp, 1));
- do_jump
- (fold
- (build2 (TRUTH_ORIF_EXPR, TREE_TYPE (exp),
- fold (build2 (NE_EXPR, TREE_TYPE (exp),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- exp0)),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- exp1)))),
- fold (build2 (NE_EXPR, TREE_TYPE (exp),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- exp0)),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- exp1)))))),
- if_false_label, if_true_label);
- }
-
+ /* Lowered by gimplify.c. */
+ abort ();
else if (integer_zerop (TREE_OPERAND (exp, 1)))
do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label);
-
else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
&& !can_compare_p (NE, TYPE_MODE (inner_type), ccp_jump))
do_jump_by_parts_equality (exp, if_true_label, if_false_label);
@@ -602,15 +494,6 @@
default:
normal:
temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);
-#if 0
- /* This is not needed any more and causes poor code since it causes
- comparisons and tests from non-SI objects to have different code
- sequences. */
- /* Copy to register to avoid generating bad insns by cse
- from (set (mem ...) (arithop)) (set (cc0) (mem ...)). */
- if (!cse_not_expected && MEM_P (temp))
- temp = copy_to_reg (temp);
-#endif
do_pending_stack_adjust ();
if (GET_CODE (temp) == CONST_INT