OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:15 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GGC Sibling Calls Optimization
PostPosted: Mon Oct 29, 2018 5:12 am 
Offline
Member
Member

Joined: Mon Jun 04, 2018 8:10 am
Posts: 44
Hi,

I am currently trying to make a small OS kernel, but there is something I don't understand: what does GCC actually do when the -foptimize-sibling-calls option is on?
Because when I turn this option on then the kernel runs into General Protection fault.

I looked at the generated assembler code and saw some differences but does someone know what are actually theses differences doing?

Regards


Top
 Profile  
 
 Post subject: Re: GGC Sibling Calls Optimization
PostPosted: Mon Oct 29, 2018 6:39 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
It performs tail call elimination between two functions, as long as both functions have compatible signatures.

If optimizations are causing your code to crash, there's probably a bug in your code.


Top
 Profile  
 
 Post subject: Re: GGC Sibling Calls Optimization
PostPosted: Wed Oct 31, 2018 7:49 am 
Offline
Member
Member

Joined: Mon Jun 04, 2018 8:10 am
Posts: 44
Ok thank you for your reply. But do you have any piece of advice to track bugs that are "optimization related" ?


Top
 Profile  
 
 Post subject: Re: GGC Sibling Calls Optimization
PostPosted: Wed Oct 31, 2018 8:09 am 
Offline
Member
Member

Joined: Thu Jul 05, 2007 8:58 am
Posts: 223
Enable compiler warnings and fix them. This will not fix all such bugs, but will significantly reduce their number. Of the things that remain, my experience has been that they are typically related to some sort of data race between threads and/or missing indications of reordering restrictions and such on port access and memory mapped hardware accesses. Beyond that, bochs and its build in debugger can be really useful tools, as they allow you to observe code behaviour in fairly high detail without disturbing execution flow.


Top
 Profile  
 
 Post subject: Re: GGC Sibling Calls Optimization
PostPosted: Thu Nov 01, 2018 4:03 am 
Offline
Member
Member

Joined: Mon Jun 04, 2018 8:10 am
Posts: 44
Ok thanks a lot for your reply, I'll try Bochs!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group