From 9b013f620f21bf90eeb66730b64bda9d193565ec Mon Sep 17 00:00:00 2001 From: nickc Date: Tue, 26 Jan 2016 14:02:11 +0000 Subject: [PATCH] PR target/66655 * config/i386/winnt.c (i386_pe_binds_local_p): If a function has been marked as DECL_ONE_ONLY but we do not the means to make it so, then do not allow it to bind locally. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232828 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/winnt.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e84acc123aca..4dba48fa477f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-01-26 Nick Clifton + + PR target/66655 + * config/i386/winnt.c (i386_pe_binds_local_p): If a function has + been marked as DECL_ONE_ONLY but we do not the means to make it + so, then do not allow it to bind locally. + 2016-01-26 Jakub Jelinek PR lto/69254 diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 53abf475bce9..e2b2f4b516c0 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -341,6 +341,20 @@ i386_pe_binds_local_p (const_tree exp) && TREE_PUBLIC (exp) && DECL_EXTERNAL (exp)) return true; + +#ifndef MAKE_DECL_ONE_ONLY + /* PR target/66655: If a function has been marked as DECL_ONE_ONLY + but we do not the means to make it so, then do not allow it to + bind locally. */ + if (DECL_P (exp) + && TREE_CODE (exp) == FUNCTION_DECL + && TREE_PUBLIC (exp) + && DECL_ONE_ONLY (exp) + && ! DECL_EXTERNAL (exp) + && DECL_DECLARED_INLINE_P (exp)) + return false; +#endif + return default_binds_local_p_1 (exp, 0); } -- 2.47.3