This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFC: always-inline vs unit-at-a-time
- From: Dale Johannesen <dalej at apple dot com>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Cc: Dale Johannesen <dalej at apple dot com>
- Date: Tue, 15 Mar 2005 10:21:36 -0800
- Subject: RFC: always-inline vs unit-at-a-time
Consider the following:
static inline int a() __attribute((always_inline));
static inline int b() __attribute((always_inline));
static inline int b() { a(); }
static inline int a() { }
int c() { b(); }
This compiles fine at -O2. At -O0 we get the baffling error
sorry, unimplemented: inlining failed in call to 'a': function not
considered for inlining
It seems undesirable for -O options to affect which programs will
compile.
The obvious thing to do about it is turn on -funit-at-a-time always,
but I'm
concerned about the effect on compile speed; has anybody measured it?