This is the mail archive of the gcc@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: Is cross-section inlining valid behaviour?


Thanks. I know how to use "noinline" to avoid inlining. Just our
application programmers expect the different sections guarantee that
these functions won't be compiled into same section, therefore should
never be inlined. It took a while for us to find this problem. 

Cheers,
Bingfeng

> -----Original Message-----
> From: Dave Korn [mailto:dave.korn@artimi.com] 
> Sent: 23 July 2008 16:05
> To: Bingfeng Mei; gcc@gcc.gnu.org
> Subject: RE: Is cross-section inlining valid behaviour?
> 
> Bingfeng Mei wrote on 23 July 2008 15:46:
> 
> 
> > The foo function is inlined into bar anyway even they have different
> > section attribute.  Is this a bug or expected behaviour?
> 
>   Well, I would expect it, but only in the light of knowing 
> how the compiler
> works.
> 
>   Sections are outside the scope of the C standard, so there 
> is nothing
> defined for how they would interact with inlining, but what 
> I'd expect to
> happen is that the section attribute would apply to any 
> out-of-line copy of
> the function body emitted, and would not apply to the body of 
> the function
> where it's inlined into another, because that can't even make 
> any sense.
> 
>   You could attribute ((__noinline__) it to prevent it 
> getting inlined at
> all, but I don't suppose there's any way of saying "Only 
> inline into other
> functions also in the same section".  That might well be a useful new
> attribute to invent.
> 
>     cheers,
>       DaveK
> -- 
> Can't think of a witty .sigline today....
> 
> 
> 


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