All of lore.kernel.org
 help / color / mirror / Atom feed
From: bill4carson@gmail.com (bill4carson)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question about JUMP and LINK
Date: Tue, 20 Mar 2012 10:19:34 +0800	[thread overview]
Message-ID: <4F67E936.30000@gmail.com> (raw)
In-Reply-To: <CABi1daF6XkWM2zTQ93CNtv8DMMSOb=6U3rvmbo82DWJNg5SfdQ@mail.gmail.com>



On 2012?03?16? 23:23, Dave Hylands wrote:
> Hi Bill,
>
> On Thu, Mar 15, 2012 at 11:52 PM, bill4carson<bill4carson@gmail.com>  wrote:
>> Hi, All
>>
>> The question is simple.
>>
>> func_a {
>>
>>     call func_b
>> }
>>
>> func_b {
>>
>>     call func_c
>> }
>>
>> func_c {
>>
>>         return to func_a
>> }
>>
>>
>> The compiler I use let func_c to return func_a directly, IOW when func_b
>> calls func_c, it use JUMP, other JUMP and LINK, and it's definitely not
>> a question about inline or noinline.
>>
>> So can I ask why how to let the compiler use JUMP and LINK when func_b
>> calls func_c?
>
> This is called Tail Optimization. See
> http://c2.com/cgi/wiki?TailCallOptimization
>
> gcc (I'm using 4.4.4) with -O3 does this.
>
Thanks for the information.


>> If it's not the right place to post this, sorry for the noise.
>
> The kernel newbies list is probably not the right place (since this
> has nothing to do with the kernel). It also has nothing to do with
> binutils. It's a gcc optimization, so picking a gcc list would
> probably be more appropriate.
>

-- 
I am a slow learner
but I will keep trying to fight for my dreams!

--bill

      reply	other threads:[~2012-03-20  2:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16  6:52 Question about JUMP and LINK bill4carson
2012-03-16 15:23 ` Dave Hylands
2012-03-20  2:19   ` bill4carson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F67E936.30000@gmail.com \
    --to=bill4carson@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.