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: [patch] Lno branch merge -- scalar evolutions analyzer


On Mon, 5 Jul 2004, Mark Mitchell wrote:

> I wonder if we should have a macro here for this "static inline" usage. 
> 
> When GCC (or another C99-ish compiler) is being used to build the 
> compiler, we probably really want just plain "inline".  Or maybe "extern 
> inline"?  It's a shame to duplicate this code in all the object files.

When GCC is being used (with gnu89-inline), we don't want plain inline, as
that would cause duplicate external definitions in all the object files.

When a compiler supporting C99 inline (so not GCC) is being used, plain
inline would require another translation unit giving an external
definition as well (especially as such other compilers would only be used
without optimization).

static inline should only leave duplicate definitions in the object files,
with either GNU or C99 inline, if the function isn't always inlined.  
Unless we take the address of the function, etc., failure to inline such
functions would clearly be a bug if compiling with any optimization
(including -Os).

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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