summaryrefslogtreecommitdiff
path: root/gcc/c.opt
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-05-03 17:16:40 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-05-03 17:16:40 -0400
commitcbb4feb38e39bac728d1a0d053f14d9868d99e8d (patch)
treef66f3527bad37dd8ad2f5c0b5d0966b9ca678f5b /gcc/c.opt
parente492f63ba96ba25a74ebbfab09cb12d403c0bc1d (diff)
downloadgcc-cbb4feb38e39bac728d1a0d053f14d9868d99e8d.tar.gz
re PR c++/43680 ([DR 1022] G++ is too aggressive in optimizing away bounds checking with enums)
PR c++/43680 gcc: * c.opt (-fstrict-enums): New. * doc/invoke.texi (C++ Dialect Options): Document -fstrict-enums. gcc/cp: * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE from the selected underlying type unless -fstrict-enums. Set ENUM_UNDERLYING_TYPE to have the restricted range. * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE. * class.c (check_bitfield_decl): Likewise. From-SVN: r159006
Diffstat (limited to 'gcc/c.opt')
-rw-r--r--gcc/c.opt4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c.opt b/gcc/c.opt
index 2e1933cd0d1..3ab29830886 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -783,6 +783,10 @@ fstats
C++ ObjC++
Display statistics accumulated during compilation
+fstrict-enums
+C++ ObjC++ Optimization Var(flag_strict_enums)
+Assume that values of enumeration type are always within the minimum range of that type
+
fstrict-prototype
C++ ObjC++