]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r257343
authorMartin Liska <mliska@suse.cz>
Wed, 7 Mar 2018 09:43:49 +0000 (10:43 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 7 Mar 2018 09:43:49 +0000 (09:43 +0000)
2018-03-07  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.

From-SVN: r258320

gcc/lto/ChangeLog
gcc/lto/lto-symtab.c

index b2cbe74fa6b40861981c48cf12930cb85bc981ba..5ad340e60898103f3dfd774cc59b3ed1a654a5b1 100644 (file)
@@ -1,3 +1,12 @@
+2018-03-07  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-07  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index 395dca479291a01607af144bdfb3629b3714ebc1..e6fb95fe37294f61ba1b589383cbf1294c605e48 100644 (file)
@@ -284,9 +284,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);