This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [LTO][PATCH] Check for defintions in prevailing DECLs


Revised patch.

2008-11-26  Doug Kwan  <dougkwan@google.com>

cp/ChangeLog.lto:

	* tree.c (cp_reset_lang_specifics): Fix up FUNCTION_DECLs as needed.

testsuite/ChangeLog.lto:

	* g++.dg/lto/20081125.h: New.
	* g++.dg/lto/20081125_0.C: New.
	* g++.dg/lto/20081125_1.C: New.


2008/11/26 Doug Kwan (w) <dougkwan@google.com>:
> I have another patch being tested right now.  That patch fixes up
> FUNCTION_DECLs in cp_reset_lang_specifics.  When we reach there, we
> should have seen EOF and expanded all needs functions.  Any
> FUNCTION_DECL without a GIMPLE body can be treated as an external
> reference since an external definition must be provided somewhere else
> if the DECL is used at all.
>
> -Doug
>
> 2008/11/26 Diego Novillo <dnovillo@google.com>:
>> 2008/11/26 Rafael Espindola <espindola@google.com>:
>>
>>> You can probably just use the free_lang_specifics to set DECL_EXTERNAL
>>> and TREE_STATIC for FUNCTION_DECL depending on the existence of the
>>> body. With that we can also avoid streaming out DECL_EXTERNAL and
>>> TREE_STATIC for them.
>>
>> TREE_STATIC will already have been set correctly for such functions.
>> What I don't really care for is the combination
>> DECL_EXTERNAL+TREE_STATIC.  In principle, it makes little sense to me,
>> but I don't know if this is something specific to C++ or just an
>> oversight in the parser.
>>
>> Jason, Mark, is there a special meaning for a TREE_STATIC function
>> decl to also have DECL_EXTERNAL set?  We are seeing that in class
>> methods declarations that also include the body, like:
>>
>> class A {
>>   int foo (int x) { return x - 1; }
>> };
>>
>> I'm also not sure if we are consistent in the use of TREE_STATIC.  In
>> gimple, we generally rely on gimple_body() and/or the CFG to determine
>> if a function has a body.
>>
>>
>> Diego.
>>
>

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]