diff options
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/config/i960/i960.h | 5 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.h | 3 | ||||
-rw-r--r-- | gcc/config/rs6000/darwin.h | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 5 | ||||
-rw-r--r-- | gcc/defaults.h | 5 |
8 files changed, 22 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 827bd7a..512da23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-05-02 Jason Merrill <jason@redhat.com> + + * defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c. + * c-decl.c (c_init_decl_processing): Use it. + * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Define to INT_TYPE_SIZE. + * config/i960/i960.h (BOOL_TYPE_SIZE): Don't define. + * config/mcore/mcore.h (BOOL_TYPE_SIZE): Don't define. + 2002-05-03 Kazu Hirata <kazu@cs.umass.edu> * regrename.c: Fix formatting. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0898613..ae4cebb 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2913,8 +2913,7 @@ c_init_decl_processing () boolean_true_node = integer_one_node; boolean_false_node = integer_zero_node; - /* With GCC, C99's _Bool is always of size 1. */ - c_bool_type_node = make_unsigned_type (CHAR_TYPE_SIZE); + c_bool_type_node = make_unsigned_type (BOOL_TYPE_SIZE); TREE_SET_CODE (c_bool_type_node, BOOLEAN_TYPE); TYPE_MAX_VALUE (c_bool_type_node) = build_int_2 (1, 0); TREE_TYPE (TYPE_MAX_VALUE (c_bool_type_node)) = c_bool_type_node; diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index 794b3c9..bf5aada 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -1174,11 +1174,6 @@ struct cum_args { int ca_nregparms; int ca_nstackparms; }; #define SLOW_BYTE_ACCESS 1 -/* Force sizeof(bool) == 1 to maintain binary compatibility; otherwise, the - change in SLOW_BYTE_ACCESS would have changed it to 4. */ - -#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE - /* We assume that the store-condition-codes instructions store 0 for false and some other value for true. This is the value stored for true. */ diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index 22fee84..6ef9613 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -254,9 +254,6 @@ extern const char * mcore_stack_increment_string; words. */ #define LONG_LONG_TYPE_SIZE 64 -/* the size of the boolean type -- in C++; */ -#define BOOL_TYPE_SIZE 8 - /* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY 32 diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 31efaac..81c24e7 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -233,3 +233,7 @@ Boston, MA 02111-1307, USA. */ space/speed. */ #undef MAX_LONG_TYPE_SIZE #define MAX_LONG_TYPE_SIZE 32 + +/* For binary compatibility with 2.95; Darwin C APIs use bool from + stdbool.h, which was an int-sized enum in 2.95. */ +#define BOOL_TYPE_SIZE INT_TYPE_SIZE diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20b8ccf..4e0100e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2002-05-03 Jason Merrill <jason@redhat.com> + + * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h. + 2002-04-30 Mark Mitchell <mark@codesourcery.com> ABI change, returning simple classes from functions. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f354336..c854cb7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -49,11 +49,6 @@ Boston, MA 02111-1307, USA. */ #include "c-pragma.h" #include "diagnostic.h" -#ifndef BOOL_TYPE_SIZE -/* `bool' has size and alignment `1', on all platforms. */ -#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE -#endif - static tree grokparms PARAMS ((tree)); static const char *redeclaration_error_message PARAMS ((tree, tree)); diff --git a/gcc/defaults.h b/gcc/defaults.h index 1597d52..702800a 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -293,6 +293,11 @@ do { \ #define CHAR_TYPE_SIZE BITS_PER_UNIT #endif +#ifndef BOOL_TYPE_SIZE +/* `bool' has size and alignment `1', on almost all platforms. */ +#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE +#endif + #ifndef SHORT_TYPE_SIZE #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2)) #endif |