aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-06 03:59:32 +0000
committerRichard Stallman <rms@gnu.org>1993-06-06 03:59:32 +0000
commitae8cb34677e8bbcbaff3a9d46a64a9372ee4e1df (patch)
tree149432aa562822c800d31d57e8b35d093201410b /gcc
parenta2469305ae4b27baa8afa37935942ef76ff7ffca (diff)
downloadgcc-ae8cb34677e8bbcbaff3a9d46a64a9372ee4e1df.zip
gcc-ae8cb34677e8bbcbaff3a9d46a64a9372ee4e1df.tar.gz
gcc-ae8cb34677e8bbcbaff3a9d46a64a9372ee4e1df.tar.bz2
(check_for_full_enumeration_handling): Don't create a
default label if all enumeration literals are covered by cases. From-SVN: r4640
Diffstat (limited to 'gcc')
-rw-r--r--gcc/stmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 737e217..5647d26 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3654,6 +3654,11 @@ check_for_full_enumeration_handling (type)
}
}
+#if 0
+ /* ??? This optimization is disabled because it causes valid programs to
+ fail. ANSI C does not guarantee that an expression with enum type
+ will have a value that is the same as one of the enumation literals. */
+
/* If all values were found as case labels, make one of them the default
label. Thus, this switch will never fall through. We arbitrarily pick
the last one to make the default since this is likely the most
@@ -3669,6 +3674,7 @@ check_for_full_enumeration_handling (type)
case_stack->data.case_stmt.default_label = (*l)->code_label;
*l = 0;
}
+#endif /* 0 */
}
/* Terminate a case (Pascal) or switch (C) statement