aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-10-30 14:28:23 +0100
committerJan Hubicka <jh@suse.cz>2020-10-30 14:28:23 +0100
commit40cb3f8ac875c6cf6610a5f93da571cfdd2a1513 (patch)
tree1f11e6cc61ded0b7016b5c01a721ce419d094d98
parent82ff7e3426ea926d090777173977f8bedd086816 (diff)
downloadgcc-40cb3f8ac875c6cf6610a5f93da571cfdd2a1513.zip
gcc-40cb3f8ac875c6cf6610a5f93da571cfdd2a1513.tar.gz
gcc-40cb3f8ac875c6cf6610a5f93da571cfdd2a1513.tar.bz2
Disable TBAA for array descriptors.
* trans-types.c: Include alias.h (gfc_get_array_type_bounds): Set typeless storage.
-rw-r--r--gcc/fortran/trans-types.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index b15ea667..b7129dc 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-array.h"
#include "dwarf2out.h" /* For struct array_descr_info. */
#include "attribs.h"
+#include "alias.h"
#if (GFC_MAX_DIMENSIONS < 10)
@@ -1903,6 +1904,10 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
base_type = gfc_get_array_descriptor_base (dimen, codimen, false);
TYPE_CANONICAL (fat_type) = base_type;
TYPE_STUB_DECL (fat_type) = TYPE_STUB_DECL (base_type);
+ /* Arrays of unknown type must alias with all array descriptors. */
+ TYPE_TYPELESS_STORAGE (base_type) = 1;
+ TYPE_TYPELESS_STORAGE (fat_type) = 1;
+ gcc_checking_assert (!get_alias_set (base_type) && !get_alias_set (fat_type));
tmp = TYPE_NAME (etype);
if (tmp && TREE_CODE (tmp) == TYPE_DECL)