aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-04-27 15:42:37 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-04-27 15:42:37 +0200
commitf8a36447dbdf5baafe85f953c261ec35f149dfb7 (patch)
tree69656f2b41db491442a54946801bbcfbc2ded408 /gcc/tree.h
parent304757d2ceec74e12ac43312b7eab9aa3b092126 (diff)
downloadgcc-f8a36447dbdf5baafe85f953c261ec35f149dfb7.zip
gcc-f8a36447dbdf5baafe85f953c261ec35f149dfb7.tar.gz
gcc-f8a36447dbdf5baafe85f953c261ec35f149dfb7.tar.bz2
re PR c++/80534 (7.1 RC - internal compiler error: in finish_member_declaration, at cp/semantics.c:2963)
PR c++/80534 * tree.c (type_cache_hasher::equal): Only compare TYPE_TYPELESS_STORAGE flag on non-aggregate element types. (build_array_type_1): Only hash TYPE_TYPELESS_STORAGE flag on non-aggregate element types. * tree.h (TYPE_TYPELESS_STORAGE): Fix comment typo, add more details about the flag on ARRAY_TYPEs in the comment, formatting fix. c-family/ * c-common.c (complete_array_type): Only hash TYPE_TYPELESS_STORAGE flag on non-aggregate element types. testsuite/ * g++.dg/other/pr80534-1.C: New test. * g++.dg/other/pr80534-2.C: New test. From-SVN: r247334
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 4ff19ce..6851cd7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2037,10 +2037,16 @@ extern machine_mode element_mode (const_tree t);
/* For an ARRAY_TYPE, a RECORD_TYPE, a UNION_TYPE or a QUAL_UNION_TYPE
whether the array is typeless storage or the type contains a member
- with this flag set. Such types are excempt from type-based alias
- analysis. */
+ with this flag set. Such types are exempt from type-based alias
+ analysis. For ARRAY_TYPEs with AGGREGATE_TYPE_P element types
+ the flag should be inherited from the element type, can change
+ when type is finalized and because of that should not be used in
+ type hashing. For ARRAY_TYPEs with non-AGGREGATE_TYPE_P element types
+ the flag should not be changed after the array is created and should
+ be used in type hashing. */
#define TYPE_TYPELESS_STORAGE(NODE) \
- (TREE_CHECK4 (NODE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ARRAY_TYPE)->type_common.typeless_storage)
+ (TREE_CHECK4 (NODE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, \
+ ARRAY_TYPE)->type_common.typeless_storage)
/* Indicated that objects of this type should be laid out in as
compact a way as possible. */