Jump to content

Recommended Posts

Posted

_gfxGetStackState and _gfxGetStackStateInFn are not guarded against inlining wich breaks the detection algorithm in some cases. Not having them static helps but is far from a garanty. I have hit this isse with -flto -Oz on gcc for example. A __attribute__ ((noinline)) fixed it.

Posted

The problem with  adding the attribute tag  is that it is a compiler specific solution. This means that adding the attribute actually breaks the code for other compilers.

The solution of course is to make a compiler specific macro that defines it as the attribute where possible and defines it as blank otherwise.

There are lots of optimiser style bugs that exist and each compiler,  and every optimisation level, is different. GCC is particularly bad, or atleast it was a few years ago when I was playing with this stuff. It is often hard to find bugs that are not source bugs but rather optimiser bugs.

In summary, well done on finding this, and especially in finding a solution. When Joel or I find a moment we will add a suitable "no-inline" macro to these calls.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...