From 1e1933372608930414255b4f5124713d227f2f9c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 30 Oct 1999 14:40:05 -0700 Subject: [PATCH] * genrecog.c (write_switch): Check for duplicate CODE cases. From-SVN: r30276 --- gcc/ChangeLog | 4 ++++ gcc/genrecog.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 718a270bb9f..330d5abdf66 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Sat Oct 30 14:38:22 1999 Richard Henderson + + * genrecog.c (write_switch): Check for duplicate CODE cases. + Sat Oct 30 14:31:48 1999 Richard Henderson * ggc-common.c: Update pre-function commentary. diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 5aea00490f0..464c49921a7 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -1695,13 +1695,14 @@ write_switch (start, depth) { char codemap[NUM_RTX_CODE]; struct decision *ret; + RTX_CODE code; memset (codemap, 0, sizeof(codemap)); printf (" switch (GET_CODE (x%d))\n {\n", depth); + code = p->tests->u.code; do { - RTX_CODE code = p->tests->u.code; printf (" case "); print_code (code); printf (":\n goto L%d;\n", p->success.first->number); @@ -1710,7 +1711,10 @@ write_switch (start, depth) codemap[code] = 1; p = p->next; } - while (p && p->tests->type == DT_code && !p->tests->next); + while (p + && ! p->tests->next + && p->tests->type == DT_code + && ! codemap[code = p->tests->u.code]); /* If P is testing a predicate that we know about and we haven't seen any of the codes that are valid for the predicate, we can