[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Getting inline to work
From: |
eric |
Subject: |
Re: [avr-gcc-list] Getting inline to work |
Date: |
Thu, 22 May 2003 23:31:53 GMT |
> address@hidden wrote:
> > Hello all
> >
> > I'm having a difficult time trying to get inline to
work.
> >
> > I have:
> >
> > // prototypes
> > static inline void foo(void);
> > static void bar(void);
> >
> > static inline void foo(void)
> > {
> > //...
> > }
> >
> > static void bar(void)
> > {
> > //...
> > foo();
> > //...
> > foo();
> > //...
> > foo();
> > //...
> > }
> >
> > I use -std=gnu99 -Os as well as -Winline and I don't
get
> > any warnings / errors and the listing shows that bar is
> > *calling* foo; i.e. foo isn't getting inlined.
>
> Try -finline-limit=<your favourite number>, or -O2. With -
Os, avr-gcc
> has a *very low* limit on the size of functions it will
inline.
>
> David Gay
> address@hidden
>
Tried -02. Tried -finline-limit=10000.
Still no luck. So I used a macro to force inlining.
Thanks for the info anyway.
Eric