]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* genrecog.c (write_switch): Check for duplicate CODE cases.
authorRichard Henderson <rth@cygnus.com>
Sat, 30 Oct 1999 21:40:05 +0000 (14:40 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 30 Oct 1999 21:40:05 +0000 (14:40 -0700)
From-SVN: r30276

gcc/ChangeLog
gcc/genrecog.c

index 718a270bb9fd20478a960c5e1b51b2ee731891da..330d5abdf668f6962cbdf436013bb65e0bd68516 100644 (file)
@@ -1,3 +1,7 @@
+Sat Oct 30 14:38:22 1999  Richard Henderson  <rth@cygnus.com>
+
+       * genrecog.c (write_switch): Check for duplicate CODE cases.
+
 Sat Oct 30 14:31:48 1999  Richard Henderson  <rth@cygnus.com>
 
        * ggc-common.c: Update pre-function commentary.
index 5aea00490f0fcfe11fa1f2ccffb0c91151b0fd0a..464c49921a7f6ac4da58dc4c998aff358531d32b 100644 (file)
@@ -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