summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2018-03-06 20:02:03 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2018-03-06 20:02:03 +0000
commitb608468036329eb9d03a5f5d31a561843c342232 (patch)
tree3ee3435090b10164c9cb07314242ac5ba163a077
parentea1d2eeccf27610dfc436701fe2039c057d715a8 (diff)
downloadgcc-b608468036329eb9d03a5f5d31a561843c342232.tar.gz
Backport r257343
2018-03-06 Martin Liska <mliska@suse.cz> Backport from mainline 2018-02-02 Eric Botcazou <ebotcazou@adacore.com> PR lto/83954 * lto-symtab.c (warn_type_compatibility_p): Do not recurse into the component type of array types with non-aliased component. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@258286 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto-symtab.c9
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 88ab89a3d1b..20ee0c2004d 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,6 +1,15 @@
2018-03-06 Martin Liska <mliska@suse.cz>
Backport from mainline
+ 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR lto/83954
+ * lto-symtab.c (warn_type_compatibility_p): Do not recurse into the
+ component type of array types with non-aliased component.
+
+2018-03-06 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
2018-01-30 Jan Hubicka <hubicka@ucw.cz>
PR lto/83954
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 802453ea699..5ce5a447b3f 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -287,9 +287,12 @@ warn_type_compatibility_p (tree prevailing_type, tree type,
{
tree t1 = type, t2 = prevailing_type;
- /* Alias sets of arrays are the same as alias sets of the inner
- types. */
- while (TREE_CODE (t1) == ARRAY_TYPE && TREE_CODE (t2) == ARRAY_TYPE)
+ /* Alias sets of arrays with aliased components are the same as alias
+ sets of the inner types. */
+ while (TREE_CODE (t1) == ARRAY_TYPE
+ && !TYPE_NONALIASED_COMPONENT (t1)
+ && TREE_CODE (t2) == ARRAY_TYPE
+ && !TYPE_NONALIASED_COMPONENT (t2))
{
t1 = TREE_TYPE (t1);
t2 = TREE_TYPE (t2);