Commit 5b7c7046 by Andreas Jaeger Committed by Andreas Jaeger

Makefile.in (insn-recog.o): Add dependency on reload.h.

	* Makefile.in (insn-recog.o): Add dependency on reload.h.

	* genrecog.c (write_header): Include reload.h for prototypes in
	insn-recog.c.

From-SVN: r43722
parent f5f4be42
2001-07-03 Andreas Jaeger <aj@suse.de>
* Makefile.in (insn-recog.o): Add dependency on reload.h.
* genrecog.c (write_header): Include reload.h for prototypes in
insn-recog.c.
2001-07-03 Neil Booth <neil@daikokuya.demon.co.uk> 2001-07-03 Neil Booth <neil@daikokuya.demon.co.uk>
config: config:
......
...@@ -1619,7 +1619,7 @@ s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change ...@@ -1619,7 +1619,7 @@ s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \ insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
real.h output.h flags.h $(SYSTEM_H) function.h hard-reg-set.h resource.h \ real.h output.h flags.h $(SYSTEM_H) function.h hard-reg-set.h resource.h \
$(TM_P_H) toplev.h $(TM_P_H) toplev.h reload.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
insn-recog.c: s-recog ; @true insn-recog.c: s-recog ; @true
......
/* Generate code from machine description to recognize rtl as insns. /* Generate code from machine description to recognize rtl as insns.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998, Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998,
1999, 2000 Free Software Foundation, Inc. 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -73,7 +73,7 @@ struct decision_head ...@@ -73,7 +73,7 @@ struct decision_head
struct decision *first; struct decision *first;
struct decision *last; struct decision *last;
}; };
/* A single test. The two accept types aren't tests per-se, but /* A single test. The two accept types aren't tests per-se, but
their equality (or lack thereof) does affect tree merging so their equality (or lack thereof) does affect tree merging so
it is convenient to keep them here. */ it is convenient to keep them here. */
...@@ -88,7 +88,7 @@ struct decision_test ...@@ -88,7 +88,7 @@ struct decision_test
{ {
DT_mode, DT_code, DT_veclen, DT_mode, DT_code, DT_veclen,
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe, DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
DT_veclen_ge, DT_dup, DT_pred, DT_c_test, DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
DT_accept_op, DT_accept_insn DT_accept_op, DT_accept_insn
} type; } type;
...@@ -295,7 +295,7 @@ static struct decision_head make_insn_sequence ...@@ -295,7 +295,7 @@ static struct decision_head make_insn_sequence
PARAMS ((rtx, enum routine_type)); PARAMS ((rtx, enum routine_type));
static void process_tree static void process_tree
PARAMS ((struct decision_head *, enum routine_type)); PARAMS ((struct decision_head *, enum routine_type));
static void record_insn_name static void record_insn_name
PARAMS ((int, const char *)); PARAMS ((int, const char *));
...@@ -570,7 +570,7 @@ validate_pattern (pattern, insn, set, set_code) ...@@ -570,7 +570,7 @@ validate_pattern (pattern, insn, set, set_code)
&& XSTR (pattern, 2)[0] != '+') && XSTR (pattern, 2)[0] != '+')
{ {
message_with_line (pattern_lineno, message_with_line (pattern_lineno,
"operand %d missing output reload", "operand %d missing output reload",
XINT (pattern, 0)); XINT (pattern, 0));
error_count++; error_count++;
} }
...@@ -591,7 +591,7 @@ validate_pattern (pattern, insn, set, set_code) ...@@ -591,7 +591,7 @@ validate_pattern (pattern, insn, set, set_code)
/* A modeless MATCH_OPERAND can be handy when we can /* A modeless MATCH_OPERAND can be handy when we can
check for multiple modes in the c_test. In most other cases, check for multiple modes in the c_test. In most other cases,
it is a mistake. Only DEFINE_INSN is eligible, since SPLIT it is a mistake. Only DEFINE_INSN is eligible, since SPLIT
and PEEP2 can FAIL within the output pattern. Exclude and PEEP2 can FAIL within the output pattern. Exclude
address_operand, since its mode is related to the mode of address_operand, since its mode is related to the mode of
the memory not the operand. Exclude the SET_DEST of a call the memory not the operand. Exclude the SET_DEST of a call
instruction, as that is a common idiom. */ instruction, as that is a common idiom. */
...@@ -659,7 +659,7 @@ validate_pattern (pattern, insn, set, set_code) ...@@ -659,7 +659,7 @@ validate_pattern (pattern, insn, set, set_code)
error_count++; error_count++;
} }
/* If only one of the operands is VOIDmode, and PC or CC0 is /* If only one of the operands is VOIDmode, and PC or CC0 is
not involved, it's probably a mistake. */ not involved, it's probably a mistake. */
else if (dmode != smode else if (dmode != smode
&& GET_CODE (dest) != PC && GET_CODE (dest) != PC
...@@ -1300,7 +1300,7 @@ nodes_identical_1 (d1, d2) ...@@ -1300,7 +1300,7 @@ nodes_identical_1 (d1, d2)
} }
/* True iff the two nodes are identical (on one level only). Due /* True iff the two nodes are identical (on one level only). Due
to the way these lists are constructed, we shouldn't have to to the way these lists are constructed, we shouldn't have to
consider different orderings on the tests. */ consider different orderings on the tests. */
static int static int
...@@ -1336,7 +1336,7 @@ nodes_identical (d1, d2) ...@@ -1336,7 +1336,7 @@ nodes_identical (d1, d2)
/* A subroutine of merge_trees; given two nodes that have been declared /* A subroutine of merge_trees; given two nodes that have been declared
identical, cope with two insn accept states. If they differ in the identical, cope with two insn accept states. If they differ in the
number of clobbers, then the conflict was created by make_insn_sequence number of clobbers, then the conflict was created by make_insn_sequence
and we can drop the with-clobbers version on the floor. If both and we can drop the with-clobbers version on the floor. If both
nodes have no additional clobbers, we have found an ambiguity in the nodes have no additional clobbers, we have found an ambiguity in the
source machine description. */ source machine description. */
...@@ -1424,7 +1424,7 @@ merge_trees (oldh, addh) ...@@ -1424,7 +1424,7 @@ merge_trees (oldh, addh)
that tests just the same mode. that tests just the same mode.
If we have no match, place NEW after the closest match we found. */ If we have no match, place NEW after the closest match we found. */
for (old = oldh->last; old; old = old->prev) for (old = oldh->last; old; old = old->prev)
{ {
if (nodes_identical (old, add)) if (nodes_identical (old, add))
...@@ -1466,7 +1466,7 @@ merge_trees (oldh, addh) ...@@ -1466,7 +1466,7 @@ merge_trees (oldh, addh)
} }
} }
/* Walk the tree looking for sub-nodes that perform common tests. /* Walk the tree looking for sub-nodes that perform common tests.
Factor out the common test into a new node. This enables us Factor out the common test into a new node. This enables us
(depending on the test type) to emit switch statements later. */ (depending on the test type) to emit switch statements later. */
...@@ -1488,7 +1488,7 @@ factor_tests (head) ...@@ -1488,7 +1488,7 @@ factor_tests (head)
if (next->tests->type != type) if (next->tests->type != type)
continue; continue;
/* Don't want all node types, just those we can turn into /* Don't want all node types, just those we can turn into
switch statements. */ switch statements. */
if (type != DT_mode if (type != DT_mode
&& type != DT_code && type != DT_code
...@@ -1506,7 +1506,7 @@ factor_tests (head) ...@@ -1506,7 +1506,7 @@ factor_tests (head)
new->tests = first->tests->next; new->tests = first->tests->next;
first->tests->next = NULL; first->tests->next = NULL;
} }
/* Crop the node tree off after our first test. */ /* Crop the node tree off after our first test. */
first->next = NULL; first->next = NULL;
old_last = head->last; old_last = head->last;
...@@ -1623,7 +1623,7 @@ find_afterward (head, real_afterward) ...@@ -1623,7 +1623,7 @@ find_afterward (head, real_afterward)
{ {
struct decision *p, *q, *afterward; struct decision *p, *q, *afterward;
/* We can't propogate alternatives across subroutine boundaries. /* We can't propogate alternatives across subroutine boundaries.
This is not incorrect, merely a minor optimization loss. */ This is not incorrect, merely a minor optimization loss. */
p = head->first; p = head->first;
...@@ -1636,7 +1636,7 @@ find_afterward (head, real_afterward) ...@@ -1636,7 +1636,7 @@ find_afterward (head, real_afterward)
if (maybe_both_true (p, q, 1)) if (maybe_both_true (p, q, 1))
break; break;
/* If we reached the end of the list without finding one, /* If we reached the end of the list without finding one,
use the incoming afterward position. */ use the incoming afterward position. */
if (!q) if (!q)
q = afterward; q = afterward;
...@@ -1698,12 +1698,12 @@ change_state (oldpos, newpos, afterward, indent) ...@@ -1698,12 +1698,12 @@ change_state (oldpos, newpos, afterward, indent)
/* We can only fail if we're moving down the tree. */ /* We can only fail if we're moving down the tree. */
if (old_has_insn >= 0 && oldpos[old_has_insn] >= newpos[depth]) if (old_has_insn >= 0 && oldpos[old_has_insn] >= newpos[depth])
{ {
printf ("%stem = peep2_next_insn (%d);\n", printf ("%stem = peep2_next_insn (%d);\n",
indent, newpos[depth] - 'A'); indent, newpos[depth] - 'A');
} }
else else
{ {
printf ("%stem = peep2_next_insn (%d);\n", printf ("%stem = peep2_next_insn (%d);\n",
indent, newpos[depth] - 'A'); indent, newpos[depth] - 'A');
printf ("%sif (tem == NULL_RTX)\n", indent); printf ("%sif (tem == NULL_RTX)\n", indent);
if (afterward) if (afterward)
...@@ -1752,7 +1752,7 @@ write_afterward (start, afterward, indent) ...@@ -1752,7 +1752,7 @@ write_afterward (start, afterward, indent)
} }
} }
/* Emit a switch statement, if possible, for an initial sequence of /* Emit a switch statement, if possible, for an initial sequence of
nodes at START. Return the first node yet untested. */ nodes at START. Return the first node yet untested. */
static struct decision * static struct decision *
...@@ -1786,7 +1786,7 @@ write_switch (start, depth) ...@@ -1786,7 +1786,7 @@ write_switch (start, depth)
printf (" switch (GET_CODE (x%d))\n {\n", depth); printf (" switch (GET_CODE (x%d))\n {\n", depth);
code = p->tests->u.code; code = p->tests->u.code;
do do
{ {
if (p != start && p->need_label && needs_label == NULL) if (p != start && p->need_label && needs_label == NULL)
needs_label = p; needs_label = p;
...@@ -2283,7 +2283,7 @@ write_subroutine (head, type) ...@@ -2283,7 +2283,7 @@ write_subroutine (head, type)
const char *s_or_e; const char *s_or_e;
char extension[32]; char extension[32];
int i; int i;
s_or_e = subfunction ? "static " : ""; s_or_e = subfunction ? "static " : "";
if (subfunction) if (subfunction)
...@@ -2378,6 +2378,7 @@ write_header () ...@@ -2378,6 +2378,7 @@ write_header ()
#include \"hard-reg-set.h\"\n\ #include \"hard-reg-set.h\"\n\
#include \"resource.h\"\n\ #include \"resource.h\"\n\
#include \"toplev.h\"\n\ #include \"toplev.h\"\n\
#include \"reload.h\"\n\
\n"); \n");
puts ("\n\ puts ("\n\
...@@ -2660,7 +2661,7 @@ main (argc, argv) ...@@ -2660,7 +2661,7 @@ main (argc, argv)
h = make_insn_sequence (desc, PEEPHOLE2); h = make_insn_sequence (desc, PEEPHOLE2);
merge_trees (&peephole2_tree, &h); merge_trees (&peephole2_tree, &h);
} }
next_index++; next_index++;
} }
...@@ -2703,7 +2704,7 @@ record_insn_name (code, name) ...@@ -2703,7 +2704,7 @@ record_insn_name (code, name)
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = insn_name_ptr =
(char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size); (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0, memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size)); sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size; insn_name_ptr_size = new_size;
} }
...@@ -2718,9 +2719,9 @@ record_insn_name (code, name) ...@@ -2718,9 +2719,9 @@ record_insn_name (code, name)
last_real_name = new = xstrdup (name); last_real_name = new = xstrdup (name);
last_real_code = code; last_real_code = code;
} }
insn_name_ptr[code] = new; insn_name_ptr[code] = new;
} }
static void static void
debug_decision_2 (test) debug_decision_2 (test)
...@@ -2773,7 +2774,7 @@ debug_decision_2 (test) ...@@ -2773,7 +2774,7 @@ debug_decision_2 (test)
fprintf (stderr, "A_op=%d", test->u.opno); fprintf (stderr, "A_op=%d", test->u.opno);
break; break;
case DT_accept_insn: case DT_accept_insn:
fprintf (stderr, "A_insn=(%d,%d)", fprintf (stderr, "A_insn=(%d,%d)",
test->u.insn.code_number, test->u.insn.num_clobbers_to_add); test->u.insn.code_number, test->u.insn.num_clobbers_to_add);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment