From: ktietz Date: Thu, 27 May 2010 08:13:58 +0000 (+0000) Subject: gcc/cp/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=890d0caa48695c5fb7ac1981126cf32fa892c244;p=thirdparty%2Fgcc.git gcc/cp/ 2010-05-27 Kai Tietz PR bootstrap/44287 * rtti.c (emit_support_tinfos): Check for NULL_TREE. * class.c (layout_class_type): Likewise. * decl.c (finish_enum): Likewise. * mangle.c (write_builitin_type): Likewise. gcc/ 2010-05-27 Kai Tietz PR bootstrp/44287 * c-lex.c (narrowest_unsigned_type): Check for NULL_TREE. (narrow_signed_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159912 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3469a72d22a3..9489194f9f75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-27 Kai Tietz + + PR bootstrp/44287 + * c-lex.c (narrowest_unsigned_type): Check for NULL_TREE. + (narrow_signed_type): Likewise. + 2010-05-26 Jan Hubicka * cgraphunit.c (verify_cgraph_node): Do checking that DECL match diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 22a0068eb09f..6deec260d950 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -480,7 +480,11 @@ narrowest_unsigned_type (unsigned HOST_WIDE_INT low, for (; itk < itk_none; itk += 2 /* skip unsigned types */) { - tree upper = TYPE_MAX_VALUE (integer_types[itk]); + tree upper; + + if (integer_types[itk] == NULL_TREE) + continue; + upper = TYPE_MAX_VALUE (integer_types[itk]); if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high || ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high @@ -508,7 +512,11 @@ narrowest_signed_type (unsigned HOST_WIDE_INT low, for (; itk < itk_none; itk += 2 /* skip signed types */) { - tree upper = TYPE_MAX_VALUE (integer_types[itk]); + tree upper; + + if (integer_types[itk] == NULL_TREE) + continue; + upper = TYPE_MAX_VALUE (integer_types[itk]); if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high || ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c058ac1e134c..81aa7c17fb81 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2010-05-27 Kai Tietz + + PR bootstrap/44287 + * rtti.c (emit_support_tinfos): Check for NULL_TREE. + * class.c (layout_class_type): Likewise. + * decl.c (finish_enum): Likewise. + * mangle.c (write_builitin_type): Likewise. + 2010-05-26 Kai Tietz * cp-tree.h (cp_decl_specifier_seq): Add new bifield diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 523f401e8687..c2831c1a4858 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4975,14 +4975,19 @@ layout_class_type (tree t, tree *virtuals_p) of the field. Then, we are supposed to use the left over bits as additional padding. */ for (itk = itk_char; itk != itk_none; ++itk) - if (INT_CST_LT (DECL_SIZE (field), - TYPE_SIZE (integer_types[itk]))) + if (integer_types[itk] != NULL_TREE + && INT_CST_LT (DECL_SIZE (field), + TYPE_SIZE (integer_types[itk]))) break; /* ITK now indicates a type that is too large for the field. We have to back up by one to find the largest type that fits. */ - integer_type = integer_types[itk - 1]; + do + { + --itk; + integer_type = integer_types[itk]; + } while (itk > 0 && integer_type == NULL_TREE); /* Figure out how much additional padding is required. GCC 3.2 always created a padding field, even if it had zero diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 495660dec294..e560cb47b1d3 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11402,7 +11402,8 @@ finish_enum (tree enumtype) itk++) { underlying_type = integer_types[itk]; - if (TYPE_PRECISION (underlying_type) >= precision + if (underlying_type != NULL_TREE + && TYPE_PRECISION (underlying_type) >= precision && TYPE_UNSIGNED (underlying_type) == unsignedp) break; } diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a8a80a9b5357..e8259521adb9 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2055,7 +2055,8 @@ write_builtin_type (tree type) it in the array of these nodes. */ iagain: for (itk = 0; itk < itk_none; ++itk) - if (type == integer_types[itk]) + if (integer_types[itk] != NULL_TREE + && type == integer_types[itk]) { /* Print the corresponding single-letter code. */ write_char (integer_type_codes[itk]); diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 17664f57ed51..62aa92129295 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1502,6 +1502,8 @@ emit_support_tinfos (void) tree types[3]; int i; + if (bltn == NULL_TREE) + continue; types[0] = bltn; types[1] = build_pointer_type (bltn); types[2] = build_pointer_type (cp_build_qualified_type (bltn,