|
From: | Bob Weber |
Subject: | Subject: Re: [avr-gcc-list] Getting inline to work |
Date: | 23 May 2003 14:31:20 -0700 |
> address@hidden wrote:I've had the same problem with inlines, even with optimization at -O3. It's just a suggestion to the compiler, or so I've read, and sometimes the compiler won't/cannot inline the function.
> > 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
[Prev in Thread] | Current Thread | [Next in Thread] |