From: Richard Guenther Date: Tue, 7 Jun 2011 13:01:27 +0000 (+0000) Subject: tree.c (build_common_tree_nodes): Also initialize size_type_node. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=009db074870ccdf44bafc9d3f604246ddb80974b;p=gcc.git tree.c (build_common_tree_nodes): Also initialize size_type_node. 2011-06-07 Richard Guenther * tree.c (build_common_tree_nodes): Also initialize size_type_node. Call set_sizetype from here. c-family/ * c-common.c (c_common_nodes_and_builtins): Do not set size_type_node or call set_sizetype. go/ * go-lang.c (go_langhook_init): Do not set size_type_node or call set_sizetype. fortran/ * f95-lang.c (gfc_init_decl_processing): Do not set size_type_node or call set_sizetype. java/ * decl.c (java_init_decl_processing): Properly initialize size_type_node. lto/ * lto-lang.c (lto_init): Do not set size_type_node or call set_sizetype. ada/ * gcc-interface/misc.c (gnat_init): Do not set size_type_node or call set_sizetype. From-SVN: r174743 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d8ac5c93c7..4dd12e31dbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * tree.c (build_common_tree_nodes): Also initialize size_type_node. + Call set_sizetype from here. + 2011-06-07 Andrew Stubbs * config/arm/arm.md (*maddhidi4tb, *maddhidi4tt): New define_insns. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a54c3369719..17eb8963a1d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * gcc-interface/misc.c (gnat_init): Do not set + size_type_node or call set_sizetype. + 2011-06-06 Eric Botcazou * gcc-interface/utils2.c (gnat_stabilize_reference): Propagate diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 4067e01e78d..e69668ae852 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -309,17 +309,6 @@ gnat_init (void) matter since we'll use the explicit `unsigned char' for Character. */ build_common_tree_nodes (flag_signed_char); - /* In Ada, we use the unsigned type corresponding to the width of Pmode as - SIZETYPE. In most cases when ptr_mode and Pmode differ, C will use the - width of ptr_mode for SIZETYPE, but we get better code using the width - of Pmode. Note that, although we manipulate negative offsets for some - internal constructs and rely on compile time overflow detection in size - computations, using unsigned types for SIZETYPEs is fine since they are - treated specially by the middle-end, in particular sign-extended. */ - size_type_node = gnat_type_for_mode (Pmode, 1); - set_sizetype (size_type_node); - TYPE_NAME (sizetype) = get_identifier ("size_type"); - /* In Ada, we use an unsigned 8-bit type for the default boolean type. */ boolean_type_node = make_unsigned_type (8); TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE); diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index f0592f5390b..1c5f9d3e001 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * c-common.c (c_common_nodes_and_builtins): Do not set + size_type_node or call set_sizetype. + 2011-06-07 Dodji Seketeli PR debug/49130 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index dbef4b314ea..e5c070f940b 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -4666,13 +4666,7 @@ c_common_nodes_and_builtins (void) TYPE_DECL, NULL_TREE, widest_unsigned_literal_type_node)); - /* `unsigned long' is the standard type for sizeof. - Note that stddef.h uses `unsigned long', - and this must agree, even if long and int are the same size. */ - size_type_node = - TREE_TYPE (identifier_global_value (get_identifier (SIZE_TYPE))); signed_size_type_node = c_common_signed_type (size_type_node); - set_sizetype (size_type_node); pid_type_node = TREE_TYPE (identifier_global_value (get_identifier (PID_TYPE))); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index af16e578341..33199109cc7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * f95-lang.c (gfc_init_decl_processing): Do not set + size_type_node or call set_sizetype. + 2011-06-05 Tobias Burnus PR fortran/49255 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index e247d70a6c0..fea76102c35 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -590,9 +590,6 @@ gfc_init_decl_processing (void) want double_type_node to actually have double precision. */ build_common_tree_nodes (false); - size_type_node = gfc_build_uint_type (POINTER_SIZE); - set_sizetype (size_type_node); - build_common_tree_nodes_2 (0); void_list_node = build_tree_list (NULL_TREE, void_type_node); diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 5df1e050b87..edaadec3c47 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * go-lang.c (go_langhook_init): Do not set + size_type_node or call set_sizetype. + 2011-05-27 Ian Lance Taylor * go-backend.c: Include "output.h". diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 84c7f8d1591..4687c6e19ba 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -87,15 +87,6 @@ go_langhook_init (void) { build_common_tree_nodes (false); - /* The sizetype may be "unsigned long" or "unsigned long long". */ - if (TYPE_MODE (long_unsigned_type_node) == ptr_mode) - size_type_node = long_unsigned_type_node; - else if (TYPE_MODE (long_long_unsigned_type_node) == ptr_mode) - size_type_node = long_long_unsigned_type_node; - else - size_type_node = long_unsigned_type_node; - set_sizetype (size_type_node); - build_common_tree_nodes_2 (0); /* We must create the gogo IR after calling build_common_tree_nodes diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 1e50bc86e6c..b29e9c29f00 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * decl.c (java_init_decl_processing): Properly initialize + size_type_node. + 2011-05-30 Joern Rennecke PR middle-end/46500 diff --git a/gcc/java/decl.c b/gcc/java/decl.c index e9581368088..0ee23742a16 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -606,7 +606,14 @@ java_init_decl_processing (void) /* This is not a java type, however tree-dfa requires a definition for size_type_node. */ - size_type_node = make_unsigned_type (POINTER_SIZE); + if (strcmp (SIZE_TYPE, "unsigned int") == 0) + size_type_node = make_unsigned_type (INT_TYPE_SIZE); + else if (strcmp (SIZE_TYPE, "long unsigned int") == 0) + size_type_node = make_unsigned_type (LONG_TYPE_SIZE); + else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0) + size_type_node = make_unsigned_type (LONG_LONG_TYPE_SIZE); + else + gcc_unreachable (); set_sizetype (size_type_node); /* Define these next since types below may used them. */ diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index e8393c1f523..0d980ee3fc6 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Richard Guenther + + * lto-lang.c (lto_init): Do not set + size_type_node or call set_sizetype. + 2011-06-04 Diego Novillo * lto.c (lto_init): New. diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 296a71976d1..8a4cee029d3 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -1087,17 +1087,6 @@ lto_init (void) /* Create the basic integer types. */ build_common_tree_nodes (flag_signed_char); - /* Tell the middle end what type to use for the size of objects. */ - if (strcmp (SIZE_TYPE, "unsigned int") == 0) - size_type_node = unsigned_type_node; - else if (strcmp (SIZE_TYPE, "long unsigned int") == 0) - size_type_node = long_unsigned_type_node; - else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0) - size_type_node = long_long_unsigned_type_node; - else - gcc_unreachable (); - set_sizetype (size_type_node); - /* The global tree for the main identifier is filled in by language-specific front-end initialization that is not run in the LTO back-end. It appears that all languages that perform such diff --git a/gcc/tree.c b/gcc/tree.c index 764a0f422df..a2ea14c82ac 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -9142,6 +9142,7 @@ build_common_tree_nodes (bool signed_char) int128_unsigned_type_node = make_unsigned_type (128); } #endif + /* Define a boolean type. This type only represents boolean values but may be larger than char depending on the value of BOOL_TYPE_SIZE. Front ends which want to override this size (i.e. Java) can redefine @@ -9151,6 +9152,17 @@ build_common_tree_nodes (bool signed_char) TYPE_MAX_VALUE (boolean_type_node) = build_int_cst (boolean_type_node, 1); TYPE_PRECISION (boolean_type_node) = 1; + /* Define what type to use for size_t. */ + if (strcmp (SIZE_TYPE, "unsigned int") == 0) + size_type_node = unsigned_type_node; + else if (strcmp (SIZE_TYPE, "long unsigned int") == 0) + size_type_node = long_unsigned_type_node; + else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0) + size_type_node = long_long_unsigned_type_node; + else + gcc_unreachable (); + set_sizetype (size_type_node); + /* Fill in the rest of the sized types. Reuse existing type nodes when possible. */ intQI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (QImode), 0);