public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* about inline
@ 2013-03-24  3:47 ishare
  2013-03-24  7:03 ` Chung-Ju Wu
  0 siblings, 1 reply; 7+ messages in thread
From: ishare @ 2013-03-24  3:47 UTC (permalink / raw)
  To: gcc-help


 If I not use optimization   in compilation , will those inline functions be actually inlined by gcc ?
 
 thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-24  3:47 about inline ishare
@ 2013-03-24  7:03 ` Chung-Ju Wu
  2013-03-24 12:22   ` Oleg Endo
  0 siblings, 1 reply; 7+ messages in thread
From: Chung-Ju Wu @ 2013-03-24  7:03 UTC (permalink / raw)
  To: ishare; +Cc: gcc-help

2013/3/24, ishare <june.tune.sea@gmail.com>:
>
>  If I not use optimization   in compilation , will those inline functions be
> actually inlined by gcc ?
>
>  thanks!
>

Not unless you use 'always_inline' attribute.

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes


Best regards,
jasonwucj

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-24  7:03 ` Chung-Ju Wu
@ 2013-03-24 12:22   ` Oleg Endo
  2013-03-25  3:29     ` ishare
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Endo @ 2013-03-24 12:22 UTC (permalink / raw)
  To: Chung-Ju Wu; +Cc: ishare, gcc-help

On Sun, 2013-03-24 at 15:03 +0800, Chung-Ju Wu wrote:
> 2013/3/24, ishare <june.tune.sea@gmail.com>:
> >
> >  If I not use optimization   in compilation , will those inline functions be
> > actually inlined by gcc ?
> >
> >  thanks!
> >
> 
> Not unless you use 'always_inline' attribute.
> 
> http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes

Also, when in error or in doubt, use option '-save-temps' and look at
the asm code that is generated by the compiler.

Cheers,
Oleg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-24 12:22   ` Oleg Endo
@ 2013-03-25  3:29     ` ishare
  2013-03-25 14:18       ` Chung-Ju Wu
  0 siblings, 1 reply; 7+ messages in thread
From: ishare @ 2013-03-25  3:29 UTC (permalink / raw)
  To: Oleg Endo; +Cc: gcc-help

On Sun, Mar 24, 2013 at 01:21:42PM +0100, Oleg Endo wrote:
> On Sun, 2013-03-24 at 15:03 +0800, Chung-Ju Wu wrote:
> > 2013/3/24, ishare <june.tune.sea@gmail.com>:
> > >
> > >  If I not use optimization   in compilation , will those inline functions be
> > > actually inlined by gcc ?
> > >
> > >  thanks!
> > >
> > 
> > Not unless you use 'always_inline' attribute.
> > 
> > http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes
> 
> Also, when in error or in doubt, use option '-save-temps' and look at
> the asm code that is generated by the compiler.
  
  Can this help to print all temp varibles on stack whose value may be optimized out by -O2 ?

  thanks!
> 
> Cheers,
> Oleg
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-25  3:29     ` ishare
@ 2013-03-25 14:18       ` Chung-Ju Wu
  2013-03-26  0:43         ` ishare
  0 siblings, 1 reply; 7+ messages in thread
From: Chung-Ju Wu @ 2013-03-25 14:18 UTC (permalink / raw)
  To: ishare; +Cc: Oleg Endo, gcc-help

2013/3/25 ishare <june.tune.sea@gmail.com>:
> On Sun, Mar 24, 2013 at 01:21:42PM +0100, Oleg Endo wrote:
>> On Sun, 2013-03-24 at 15:03 +0800, Chung-Ju Wu wrote:
>> > 2013/3/24, ishare <june.tune.sea@gmail.com>:
>> > >
>> > >  If I not use optimization   in compilation , will those inline functions be
>> > > actually inlined by gcc ?
>> > >
>> > >  thanks!
>> > >
>> >
>> > Not unless you use 'always_inline' attribute.
>> >
>> > http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes
>>
>> Also, when in error or in doubt, use option '-save-temps' and look at
>> the asm code that is generated by the compiler.
>
>   Can this help to print all temp varibles on stack whose value may be optimized out by -O2 ?
>
>   thanks!

Hi,

No. The option '-save-temps' is to store the intermediate files permanently.

If you want to know what variables/statement might be optimized out,
you should use some static code analysis tools.



Best regards,
jasonwucj

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-25 14:18       ` Chung-Ju Wu
@ 2013-03-26  0:43         ` ishare
  2013-03-26  6:24           ` Chung-Ju Wu
  0 siblings, 1 reply; 7+ messages in thread
From: ishare @ 2013-03-26  0:43 UTC (permalink / raw)
  To: Chung-Ju Wu; +Cc: gcc-help

On Mon, Mar 25, 2013 at 10:18:25PM +0800, Chung-Ju Wu wrote:
> 2013/3/25 ishare <june.tune.sea@gmail.com>:
> > On Sun, Mar 24, 2013 at 01:21:42PM +0100, Oleg Endo wrote:
> >> On Sun, 2013-03-24 at 15:03 +0800, Chung-Ju Wu wrote:
> >> > 2013/3/24, ishare <june.tune.sea@gmail.com>:
> >> > >
> >> > >  If I not use optimization   in compilation , will those inline functions be
> >> > > actually inlined by gcc ?
> >> > >
> >> > >  thanks!
> >> > >
> >> >
> >> > Not unless you use 'always_inline' attribute.
> >> >
> >> > http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes
> >>
> >> Also, when in error or in doubt, use option '-save-temps' and look at
> >> the asm code that is generated by the compiler.
> >
> >   Can this help to print all temp varibles on stack whose value may be optimized out by -O2 ?
> >
> >   thanks!
> 
> Hi,
> 
> No. The option '-save-temps' is to store the intermediate files permanently.
> 
> If you want to know what variables/statement might be optimized out,
> you should use some static code analysis tools.

  Are there static code analysis tools for linux ?
  I only know some for windows .
  Thanks!
> 
> 
> 
> Best regards,
> jasonwucj

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: about inline
  2013-03-26  0:43         ` ishare
@ 2013-03-26  6:24           ` Chung-Ju Wu
  0 siblings, 0 replies; 7+ messages in thread
From: Chung-Ju Wu @ 2013-03-26  6:24 UTC (permalink / raw)
  To: ishare; +Cc: gcc-help

2013/3/26 ishare <june.tune.sea@gmail.com>:
> On Mon, Mar 25, 2013 at 10:18:25PM +0800, Chung-Ju Wu wrote:
>
>   Are there static code analysis tools for linux ?
>   I only know some for windows .
>   Thanks!

Hi,

More information can be found through web pages.

If you really have no idea where to start, here is a link for you:
http://spinroot.com/static/


Best regards,
jasonwucj

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-26  6:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-24  3:47 about inline ishare
2013-03-24  7:03 ` Chung-Ju Wu
2013-03-24 12:22   ` Oleg Endo
2013-03-25  3:29     ` ishare
2013-03-25 14:18       ` Chung-Ju Wu
2013-03-26  0:43         ` ishare
2013-03-26  6:24           ` Chung-Ju Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).