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/alias.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/alias.c')
-rw-r--r-- | gcc/alias.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index cc31ee0..efd89ce 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -613,6 +613,10 @@ component_uses_parent_alias_set_from (const_tree t) { const_tree found = NULL_TREE; + if (AGGREGATE_TYPE_P (TREE_TYPE (t)) + && TYPE_TYPELESS_STORAGE (TREE_TYPE (t))) + return const_cast <tree> (t); + while (handled_component_p (t)) { switch (TREE_CODE (t)) @@ -883,6 +887,10 @@ get_alias_set (tree t) variant. */ t = TYPE_MAIN_VARIANT (t); + if (AGGREGATE_TYPE_P (t) + && TYPE_TYPELESS_STORAGE (t)) + return 0; + /* Always use the canonical type as well. If this is a type that requires structural comparisons to identify compatible types use alias set zero. */ |