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]

PATCH: Mark an inline function one-only if it is accessible from outside


On Fri, Jan 30, 2009 at 2:43 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Fri, Jan 30, 2009 at 7:44 AM, Ian Lance Taylor <iant@google.com> wrote:
>>> I committed this patch to the gcc-in-cxx branch.  This fixes the
>>> top-level configury to not think the c++ is missing because it was
>>> explicitly enabled.  It also comments out some code which added
>>> -fkeep-inlin-functions to stage 1.  When building with C++ this breaks
>>> the inline functions which are provided by <gmp.h>, as they wind up
>>> getting included in many .o files leading to duplicate definition
>>> errors at link time.
>>>
>>
>> I also noticed that keeping inline function led to link time error.
>> Can't we mark the kept inline function linktonce?
>
> I have no objection to that.  It would make -fkeep-inline-functions
> more useful for g++.
>

Here is a patch.


-- 
H.J.
---
gcc/

2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>

	* c-decl.c (start_function): Call make_decl_one_only if an
	inline function is accessible from outside.

gcc/testsuite/

2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc.dg/inline-33.c: New.
	* gcc.dg/inline-33a.c: Likewise.

Attachment: gcc-inline-1.patch
Description: Text document


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