From f4af4019dfb79f92adcf7cee4ef9e5f6ff428a37 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 24 Jun 2019 23:13:12 +0200 Subject: ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P. * ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P. (odr_type_p): Remove extra return. * lto-streamer-out.c (hash_tree): Hash TYPE_CXX_ODR_P; hash STRING_FLAG only for arrays and integers. * tree-stremaer-in.c (unpack_ts_type_common_value_fields): Update analogously. * tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise. * print-tree.c (print_node): Print cxx-odr-p and string-flag. * tree.c (need_assembler_name_p): Also check that type is CXX_ODR_TYPE_P (verify_type_variant): Update verification of SRING_FLAG; also check CXX_ODR_P. * tree.h (ARRAY_OR_INTEGER_TYPE_CHECK): New macro. (TYPE_STRING_FLAG): Use it. (TYPE_CXX_ODR_P): New macro. * lto-common.c (compare_tree_sccs_1): Compare CXX_ODR_P; compare STRING_FLAG only for arrays and integers. * gcc-interface/decl.c (gnat_to_gnu_entity): Check that type is array or integer prior checking string flag. * gcc-interface/gigi.h (gnat_signed_type_for, maybe_character_value): Likewise. * c-common.c (braced_lists_to_strings): Check that type is array or integer prior checking string flag. * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P. * dwarf2out.c (gen_array_type_die): First check that type is an array and then test string flag. * trans-expr.c (gfc_conv_substring): Check that type is array or integer prior checking string flag. (gfc_conv_string_parameter): Likewise. * trans-openmp.c (gfc_omp_scalar_p): Likewise. * trans.c (gfc_build_array_ref): Likewise. From-SVN: r272628 --- gcc/tree.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index 23ac9b1..1a43e6b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -439,6 +439,8 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) #define NOT_RECORD_OR_UNION_CHECK(T) \ TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) +#define ARRAY_OR_INTEGER_TYPE_CHECK(T) \ + TREE_CHECK2 (T, ARRAY_TYPE, INTEGER_TYPE) #define NUMERICAL_TYPE_CHECK(T) \ TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \ @@ -2118,7 +2120,14 @@ extern machine_mode vector_type_mode (const_tree); /* If set in an ARRAY_TYPE, indicates a string type (for languages that distinguish string from array of char). If set in a INTEGER_TYPE, indicates a character type. */ -#define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type_common.string_flag) +#define TYPE_STRING_FLAG(NODE) \ + (ARRAY_OR_INTEGER_TYPE_CHECK (NODE)->type_common.string_flag) + +/* If set for RECORD_TYPE or UNION_TYPE it indicates that the type conforms + to the C++ one definition rule. This is used for LTO canonical type + computation. */ +#define TYPE_CXX_ODR_P(NODE) \ + (RECORD_OR_UNION_CHECK (NODE)->type_common.string_flag) /* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings about missing conversions to other vector types of the same size. */ -- cgit v1.1