diff options
author | Richard Biener <rguenther@suse.de> | 2017-04-12 07:35:49 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-04-12 07:35:49 +0000 |
commit | 350792ffaed9b3506582b471bf133459d7ea64ab (patch) | |
tree | f06c2718f7e849e343f4476cdd4b96146c1d52d7 /gcc/cp/tree.c | |
parent | d62e6f1078dd62f6e8937d1f48f1f77f0a78e19e (diff) | |
download | gcc-350792ffaed9b3506582b471bf133459d7ea64ab.zip gcc-350792ffaed9b3506582b471bf133459d7ea64ab.tar.gz gcc-350792ffaed9b3506582b471bf133459d7ea64ab.tar.bz2 |
re PR target/79671 (mapnik miscompilation on armv7hl since r235622)
2017-04-12 Richard Biener <rguenther@suse.de>
Bernd Edlinger <bernd.edlinger@hotmail.de>
PR middle-end/79671
* alias.c (component_uses_parent_alias_set_from): Handle
TYPE_TYPELESS_STORAGE.
(get_alias_set): Likewise.
* tree-core.h (tree_type_common): Add typeless_storage flag.
* tree.h (TYPE_TYPELESS_STORAGE): New macro.
* stor-layout.c (place_union_field): Set TYPE_TYPELESS_STORAGE
for types containing members with TYPE_TYPELESS_STORAGE.
(place_field): Likewise.
(layout_type): Likewise for ARRAY_TYPE.
* lto-streamer-out.c (hash_tree): Hash TYPE_TYPELESS_STORAGE.
* tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream
TYPE_TYPELESS_STORAGE.
* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.
lto/
* lto.c (compare_tree_sccs_1): Compare TYPE_TYPELESS_STORAGE.
cp/
* tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
for arrays of character or std::byte type.
* g++.dg/torture/pr79671.C: New testcase.
* g++.dg/lto/pr79671_0.C: Likewise.
* g++.dg/lto/pr79671_1.c: Likewise.
Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
From-SVN: r246866
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index acb9b8e..2edd567 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -949,6 +949,13 @@ build_cplus_array_type (tree elt_type, tree index_type) else { t = build_array_type (elt_type, index_type); + if (elt_type == unsigned_char_type_node + || elt_type == signed_char_type_node + || elt_type == char_type_node + || (TREE_CODE (elt_type) == ENUMERAL_TYPE + && TYPE_CONTEXT (elt_type) == std_node + && !strcmp ("byte", TYPE_NAME_STRING (elt_type)))) + TYPE_TYPELESS_STORAGE (t) = 1; } /* Now check whether we already have this array variant. */ @@ -972,6 +979,7 @@ build_cplus_array_type (tree elt_type, tree index_type) as it will overwrite alignment etc. of all variants. */ TYPE_SIZE (t) = TYPE_SIZE (m); TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (m); + TYPE_TYPELESS_STORAGE (t) = TYPE_TYPELESS_STORAGE (m); } TYPE_MAIN_VARIANT (t) = m; |