This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: dllexport and inline
2009/5/28 Nathan Sidwell <nathan@codesourcery.com>:
> Dave Korn wrote:
>>
>> Nathan Sidwell wrote:
>>>
>>> I've committed this patch from Mark, after porting it from our stable
>>> 4.3 branch. ?the issue here is that functions marked dllexport must be
>>> emitted, even if they are (also) inline.
>>>
>>> tested on i686-mingw32
>>>
>>> nathan
>>
>> ?Looks like this caused the problem being discussed at:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2009-05/threads.html#01793
>>
>> ?Could you and/or Mark cast a quick glance over the proposed solution in
>>
>> http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01796.html
>>
>> when you have a moment and tell us if it's the right thing to do? ?I think
>> it's fairly obvious.
>
> Yes adding the additional check looks right.
>
> nathan
>
> --
> Nathan Sidwell ? ?:: ? http://www.codesourcery.com ? :: ? ? ? ? CodeSourcery
>
>
Hi,
this patch fixes the issue (as Dave suggested). I tested it for
x86_64-pc-mingw32 and for i686-pc-mingw32. Is it ok for trunk?
ChangeLog
2009-05-28 Kai Tietz <kai.tietz@onevision.com>
* tree.c (handle_dll_attribute): Check if node is
of kind FUNCTION_DECL for DECL_DECLARED_INLINE_P check.
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: gcc/gcc/tree.c
===================================================================
--- gcc.orig/gcc/tree.c
+++ gcc/gcc/tree.c
@@ -4169,7 +4169,8 @@ handle_dll_attribute (tree * pnode, tree
if (*no_add_attrs == false)
DECL_DLLIMPORT_P (node) = 1;
}
- else if (DECL_DECLARED_INLINE_P (node))
+ else if (TREE_CODE (node) == FUNCTION_DECL
+ && DECL_DECLARED_INLINE_P (node))
/* An exported function, even if inline, must be emitted. */
DECL_EXTERNAL (node) = 0;