This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug w/ inline of inline?
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Eliot Dresselhaus <edressel at cisco dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 17 Oct 2004 17:18:52 -0700
- Subject: Re: bug w/ inline of inline?
- References: <200410172348.i9HNmoX04480@bemr-lnx-002.cisco.com>
Eliot Dresselhaus <edressel@cisco.com> writes:
> 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.
GCC is allowed to do either. It would be good if it produced
"return x + 2;" Please file a missed-optimization bug report.
Note that declaring the parameter inline is incorrect C.
zw