diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-05-16 23:18:29 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-05-16 23:18:29 +0000 |
commit | 259d29e396dbee07d0211196cd212c3464c5c325 (patch) | |
tree | 50d7960821ec80bd6136c7a2e9106406f64e8633 /gcc/tree.c | |
parent | 4d259d334e0a55382654f511a64d43089eccf569 (diff) | |
download | gcc-259d29e396dbee07d0211196cd212c3464c5c325.zip gcc-259d29e396dbee07d0211196cd212c3464c5c325.tar.gz gcc-259d29e396dbee07d0211196cd212c3464c5c325.tar.bz2 |
ipa-utils.h (warn_types_mismatch, [...]): Declare.
* ipa-utils.h (warn_types_mismatch, odr_or_derived_type_p,
odr_types_equivalent_p): Declare.
(odr_type_p): Use gcc_checking_assert.
(type_in_anonymous_namespace_p) Declare.
(type_with_linkage_p): Declare.
* common.opt (Wlto-type-mismatch): New warning.
* ipa-devirt.c (compound_type_base): New function.
(odr_or_derived_type_p): New function.
(odr_types_equivalent_p): New function.
(add_type_duplicate): Simplify.
(type_with_linkage_p): Add hack to prevent false positives on C types
(type_in_anonymous_namespace_p): Likewise.
* tree.c (need_assembler_name_p): Use type_with_linkage.
* tree.h (type_in_anonymous_namespace_p): Remove.
* doc/invoke.texi (-Wlto-type-mismatch): Document
* lto-symtab.c (warn_type_compatibility_p): Break out from ...;
compare ODR types (if available) and function types.
(lto_symtab_merge): ... here; output ODR violation warnings
and call warn_types_mismatch.
* gfortran.dg/lto/20091028-2_1.c: Fix return value.
* gfortran.dg/lto/pr41576_1.f90: Add interface.
* gfortran.dg/lto/pr41521_0.f90: Disable lto-type-mismatch
* gfortran.dg/lto/pr60635_0.f90: Disable lto-type-mismatch.
* gfortran.dg/lto/20091028-1_1.c: Fix return type.
* gcc.dg/lto/20120723_0.c: Disbale lto-type-mismatch.
From-SVN: r223258
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -5182,8 +5182,7 @@ need_assembler_name_p (tree decl) && DECL_NAME (decl) && decl == TYPE_NAME (TREE_TYPE (decl)) && !TYPE_ARTIFICIAL (TREE_TYPE (decl)) - && (((RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl)) - || TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE) + && ((type_with_linkage_p (TREE_TYPE (decl)) && !type_in_anonymous_namespace_p (TREE_TYPE (decl))) || TREE_CODE (TREE_TYPE (decl)) == INTEGER_TYPE) && !variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)) |