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: [C++] Avoid one place of frontend calling into targetm


Jan Hubicka wrote:

> However, Jan, it would be nice if you could arrange for these functions
>> to be always-inlined, even at -O0.  There's no reason for them to be
>> separate; the user doesn't know anything about them anyhow.  I don't
>> think that's a big deal, but it would be a bit tidier.

> OK, it is not dificult to get this done incrementally (basically at the
> time I am collecting the list, I need to drop alwaysinline attribute)
> C++ frontend can most probably do the same for
> static_construction_destruction and friends.  I guess there are no
> functions that are both static constructors and can be called dirrectly
> from other places?

Actually, there can be such functions; users can declare a function with
__attribute__((constructor)) and then call it normally.  But, there are
probably no DECL_ARTIFICIAL functions that are both static constructors
and called normally.  I think it would be best to put the always_inline
attribute only on the compiler-generated routines, at the time they are
created, rather than try to deduce it after the fact.

This is really not a big deal; I'm not trying to make work for you.
It's just a bit of unnecessary bloat at -O0.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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