GGC Sibling Calls Optimization
Page 1 of 1

Author:  LIC [ Mon Oct 29, 2018 5:12 am ]
Post subject:  GGC Sibling Calls Optimization


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?


Author:  Octocontrabass [ Mon Oct 29, 2018 6:39 am ]
Post subject:  Re: GGC Sibling Calls Optimization

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.

Author:  LIC [ Wed Oct 31, 2018 7:49 am ]
Post subject:  Re: GGC Sibling Calls Optimization

Ok thank you for your reply. But do you have any piece of advice to track bugs that are "optimization related" ?

Author:  davidv1992 [ Wed Oct 31, 2018 8:09 am ]
Post subject:  Re: GGC Sibling Calls Optimization

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.

Author:  LIC [ Thu Nov 01, 2018 4:03 am ]
Post subject:  Re: GGC Sibling Calls Optimization

Ok thanks a lot for your reply, I'll try Bochs!

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group