From d5871f4048bc6a2633f1791bb0e6796f55cc5659 Mon Sep 17 00:00:00 2001
From: kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 20 Feb 2004 14:28:13 +0000
Subject: [PATCH] 	Revert: 	2004-02-19  Kazu Hirata 
 <kazu@cs.umass.edu> 	* opts.c (decode_options): Don't use
 DEFAULT_SHORT_ENUMS. 	* system.h (DEFAULT_SHORT_ENUMS): Poison. 	*
 config/cris/cris.h: Remove a comment about 	DEFAULT_SHORT_ENUMS. 	*
 config/ip2k/ip2k.h: Likewise. 	* doc/tm.texi (DEFAULT_SHORT_ENUMS): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78168 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog          | 11 +++++++++++
 gcc/config/cris/cris.h |  2 ++
 gcc/config/ip2k/ip2k.h |  6 ++++++
 gcc/doc/tm.texi        |  9 +++++++++
 gcc/opts.c             |  4 ++++
 gcc/system.h           |  3 +--
 6 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a8495525ba8..5114bfd8b6ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2004-02-20  Kazu Hirata  <kazu@cs.umass.edu>
+
+	Revert:
+	2004-02-19  Kazu Hirata  <kazu@cs.umass.edu>
+	* opts.c (decode_options): Don't use DEFAULT_SHORT_ENUMS.
+	* system.h (DEFAULT_SHORT_ENUMS): Poison.
+	* config/cris/cris.h: Remove a comment about
+	DEFAULT_SHORT_ENUMS.
+	* config/ip2k/ip2k.h: Likewise.
+	* doc/tm.texi (DEFAULT_SHORT_ENUMS): Remove.
+
 2004-02-20  Mohan Embar  <gnustuff@thisiscool.com>
 	    Tom Tromey  <tromey@redhat.com>
 
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 10147b272590..5110f9adbfb9 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -567,6 +567,8 @@ extern int target_flags;
 /* For compatibility and historical reasons, a char should be signed.  */
 #define DEFAULT_SIGNED_CHAR 1
 
+/* No DEFAULT_SHORT_ENUMS, please.  */
+
 /* Note that WCHAR_TYPE_SIZE is used in cexp.y,
    where TARGET_SHORT is not available.  */
 #undef WCHAR_TYPE
diff --git a/gcc/config/ip2k/ip2k.h b/gcc/config/ip2k/ip2k.h
index 4685d030c1c0..6457e8bb3eff 100644
--- a/gcc/config/ip2k/ip2k.h
+++ b/gcc/config/ip2k/ip2k.h
@@ -108,6 +108,12 @@ extern int target_flags;
 
 #define DEFAULT_SIGNED_CHAR 1
 
+/* #define DEFAULT_SHORT_ENUMS	1
+   This was the default for the IP2k but gcc has a bug (as of 17th May
+   2001) in the way that library calls to the memory checker functions
+   are issues that screws things up if an enum is not equivalent to
+   an int.  */
+
 #define SIZE_TYPE "unsigned int"
 
 #define PTRDIFF_TYPE "int"
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f8e39a7dda12..395eec808933 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1605,6 +1605,15 @@ always override this default with the options @option{-fsigned-char}
 and @option{-funsigned-char}.
 @end defmac
 
+@defmac DEFAULT_SHORT_ENUMS
+A C expression to determine whether to give an @code{enum} type
+only as many bytes as it takes to represent the range of possible values
+of that type.  A nonzero value means to do that; a zero value means all
+@code{enum} types should be allocated like @code{int}.
+
+If you don't define the macro, the default is 0.
+@end defmac
+
 @defmac SIZE_TYPE
 A C expression for a string describing the name of the data type to use
 for size values.  The typedef name @code{size_t} is defined using the
diff --git a/gcc/opts.c b/gcc/opts.c
index b25ba430f187..45acba3c4f76 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -594,6 +594,10 @@ decode_options (unsigned int argc, const char **argv)
 
   /* Initialize whether `char' is signed.  */
   flag_signed_char = DEFAULT_SIGNED_CHAR;
+#ifdef DEFAULT_SHORT_ENUMS
+  /* Initialize how much space enums occupy, by default.  */
+  flag_short_enums = DEFAULT_SHORT_ENUMS;
+#endif
 
   /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
      modify it.  */
diff --git a/gcc/system.h b/gcc/system.h
index 644dfe9edf8b..31a1b92357f4 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -636,8 +636,7 @@ typedef char _Bool;
 	PROMOTED_MODE EXPAND_BUILTIN_VA_END				   \
 	LINKER_DOES_NOT_WORK_WITH_DWARF2 FUNCTION_ARG_KEEP_AS_REFERENCE	   \
 	GIV_SORT_CRITERION MAX_LONG_TYPE_SIZE MAX_LONG_DOUBLE_TYPE_SIZE	   \
-	MAX_WCHAR_TYPE_SIZE GCOV_TYPE_SIZE SHARED_SECTION_ASM_OP	   \
-	DEFAULT_SHORT_ENUMS
+	MAX_WCHAR_TYPE_SIZE GCOV_TYPE_SIZE SHARED_SECTION_ASM_OP
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
-- 
GitLab