This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug w/ inline of inline?
- From: Eliot Dresselhaus <edressel at cisco dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 17 Oct 2004 16:48:50 -0700
- Subject: bug w/ inline of inline?
In this example
static inline int f (int x) { return x + 1; }
static inline int g (int x, inline int f (int x))
{ return 1 + f (x); }
int h (int x)
{ return g (x, f); }
is h supposed to optimize to return x + 2 or supposed to actually call
f. Here's what I get with current gcc mainline cvs -O2
f:
leal 1(%rdi), %eax
ret
h:
call f
incl %eax
ret
Is this a bug? If not, how to I get gcc to emit "return x + 2"?
Thanks,
Eliot