summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-25 12:30:07 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-25 12:30:07 +0000
commit62433d51b557afd16e16f5db9e8fb3e5d86ba694 (patch)
tree53c658f06750cdef237c8cdb0035bc208fccf85b /gcc/ipa.c
parent50540fea265e7347f25e20bda369b96e00869d17 (diff)
downloadgcc-62433d51b557afd16e16f5db9e8fb3e5d86ba694.tar.gz
2010-11-25 Kai Tietz <kai.tietz@onevision.com>
* cgraphunit.c (process_function_and_variable_attributes): Mark dllexport-ed function/variables as needed. * ipa.c (cgraph_externally_visible_p): Make dllexport-ed as externally visible. 2010-11-25 Kai Tietz <kai.tietz@onevision.com> * gcc.dg/dll-8.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167144 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 28e6872ef7f..0b6518bf449 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -662,7 +662,9 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program, bool
return true;
if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (node->decl)))
return true;
-
+ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
+ && lookup_attribute ("dllexport", DECL_ATTRIBUTES (node->decl)))
+ return true;
/* When doing LTO or whole program, we can bring COMDAT functoins static.
This improves code quality and we know we will duplicate them at most twice
(in the case that we are not using plugin and link with object file
@@ -724,6 +726,10 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
if (lookup_attribute ("externally_visible",
DECL_ATTRIBUTES (vnode->decl)))
return true;
+ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
+ && lookup_attribute ("dllexport",
+ DECL_ATTRIBUTES (vnode->decl)))
+ return true;
/* See if we have linker information about symbol not being used or
if we need to make guess based on the declaration.