diff options
author | Jason Merrill <jason@redhat.com> | 2018-05-25 12:44:55 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-05-25 12:44:55 -0400 |
commit | f22ed1ed2ae240124d5a5a0b8fa2cb1fc7d62e00 (patch) | |
tree | 23b278356ded4c1eec38a302893f8c0101afb26b /gcc/symtab.c | |
parent | 18b119378a5e2fef657670441dabd98c827709a1 (diff) | |
download | gcc-f22ed1ed2ae240124d5a5a0b8fa2cb1fc7d62e00.zip gcc-f22ed1ed2ae240124d5a5a0b8fa2cb1fc7d62e00.tar.gz gcc-f22ed1ed2ae240124d5a5a0b8fa2cb1fc7d62e00.tar.bz2 |
PR c++/80485 - inline function non-zero address.
* symtab.c (nonzero_address): Check DECL_COMDAT.
From-SVN: r260762
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index 954920b..67e14d7 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1959,11 +1959,11 @@ symtab_node::nonzero_address () return true; } - /* If target is defined and not extern, we know it will be output and thus - it will bind to non-NULL. - Play safe for flag_delete_null_pointer_checks where weak definition maye + /* If target is defined and either comdat or not extern, we know it will be + output and thus it will bind to non-NULL. + Play safe for flag_delete_null_pointer_checks where weak definition may be re-defined by NULL. */ - if (definition && !DECL_EXTERNAL (decl) + if (definition && (!DECL_EXTERNAL (decl) || DECL_COMDAT (decl)) && (flag_delete_null_pointer_checks || !DECL_WEAK (decl))) { if (!DECL_WEAK (decl)) |