+2001-01-13 Richard Henderson <rth@redhat.com>
+
+ * genrecog.c (nodes_identical): Expand commentary.
+ (write_switch): Watch out for identical nodes.
+
2001-01-13 Neil Booth <neil@daikokuya.demon.co.uk>
* cppfiles.c (_cpp_fake_include): New function.
return 0;
/* Check that their subnodes are at the same position, as any one set
- of sibling decisions must be at the same position. */
+ of sibling decisions must be at the same position. Allowing this
+ requires complications to find_afterward and when change_state is
+ invoked. */
if (d1->success.first
&& d2->success.first
&& strcmp (d1->success.first->position, d2->success.first->position))
if (!p->next
|| p->tests->next
|| p->next->tests->type != type
- || p->next->tests->next)
+ || p->next->tests->next
+ || nodes_identical_1 (p->tests, p->next->tests))
return p;
/* DT_code is special in that we can do interesting things with
do
{
+ /* Merge trees will not unify identical nodes if their
+ sub-nodes are at different levels. Thus we must check
+ for duplicate cases. */
+ struct decision *q;
+ for (q = start; q != p; q = q->next)
+ if (nodes_identical_1 (p->tests, q->tests))
+ goto case_done;
+
if (p != start && p->need_label && needs_label == NULL)
needs_label = p;
p = p->next;
}
while (p && p->tests->type == type && !p->tests->next);
-
+
+ case_done:
printf (" default:\n break;\n }\n");
return needs_label != NULL ? needs_label : p;