This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: inline of inline
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Eliot Dresselhaus <edressel at cisco dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Oct 2004 01:49:48 +0200
- Subject: Re: inline of inline
- References: <200410172315.i9HNFbo04458@bemr-lnx-002.cisco.com>
>
> 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"?
Currently GCC never inline indirect calls (even tought it did before
unit-at-a-time has been implemented). We will hopefully get this
feature back with IPA constant propagation and clonning.
Honza
>
> Thanks,
>
> Eliot