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/stor-layout.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/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index d0beebf..10e9a32 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1091,6 +1091,10 @@ place_union_field (record_layout_info rli, tree field) if (TREE_CODE (TREE_TYPE (field)) == ERROR_MARK) return; + if (AGGREGATE_TYPE_P (TREE_TYPE (field)) + && TYPE_TYPELESS_STORAGE (TREE_TYPE (field))) + TYPE_TYPELESS_STORAGE (rli->t) = 1; + /* We assume the union's size will be a multiple of a byte so we don't bother with BITPOS. */ if (TREE_CODE (rli->t) == UNION_TYPE) @@ -1168,6 +1172,10 @@ place_field (record_layout_info rli, tree field) return; } + if (AGGREGATE_TYPE_P (type) + && TYPE_TYPELESS_STORAGE (type)) + TYPE_TYPELESS_STORAGE (rli->t) = 1; + /* Work out the known alignment so far. Note that A & (-A) is the value of the least-significant bit in A that is one. */ if (! integer_zerop (rli->bitpos)) @@ -2340,6 +2348,8 @@ layout_type (tree type) SET_TYPE_MODE (type, BLKmode); } } + if (AGGREGATE_TYPE_P (element)) + TYPE_TYPELESS_STORAGE (type) = TYPE_TYPELESS_STORAGE (element); /* When the element size is constant, check that it is at least as large as the element alignment. */ if (TYPE_SIZE_UNIT (element) |