From ee034d3108105353a2130a2d0d3630e5f8214811 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 2 Feb 2018 18:09:32 +0000 Subject: 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 --- gcc/lto/ChangeLog | 6 ++++++ gcc/lto/lto-symtab.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'gcc/lto') diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7265b76..e51fa1c 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2018-02-02 Eric Botcazou + + 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-01-30 Jan Hubicka PR lto/83954 diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 0508c5e..4f186ae 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); -- cgit v1.1