summaryrefslogtreecommitdiff
path: root/gcc/lto/lto-symtab.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-02-02 18:09:32 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-02-02 18:09:32 +0000
commitee034d3108105353a2130a2d0d3630e5f8214811 (patch)
tree5ccdd70d4f0b6784c546fa2294d377c157cf9ecd /gcc/lto/lto-symtab.c
parentaa81b142afd82cef291a1940b2dbca80807af59a (diff)
re PR lto/83954 (LTO: Bogus -Wlto-type-mismatch warning for array of pointer to incomplete type)
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: r257343
Diffstat (limited to 'gcc/lto/lto-symtab.c')
-rw-r--r--gcc/lto/lto-symtab.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 0508c5e6750..4f186aed059 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -288,9 +288,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);