You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stackless contains a few places, where it has to prevent overly compiler optimisation for the following reasons:
Stack pointer manipulation using alloca() without accessing the allocated memory.
Storing data on the stack just before hard switching
Using the address of identical functions to identify the function.
Currently Stackless writes the address of the object / a dummy value to a global variable with external linkage. This works as long as the compiler/linker can't optimise away this variable. A conventional compile, then link tool chain can't do this, but a tool chain with whole program optimisation can. Pull request #163 reports such a problem and issue #173 might also be caused by whole program optimisation. Linux is not affected, because ELF requires that a variable with external linkage can be dynamically linked at run time.
akruis
changed the title
Replace slp_dont_optimize... vars by more apropriate code
Replace slp_dont_optimize... vars by more appropriate code
Nov 11, 2018
by more appropriate compiler specific code. The new code should work
with whole program optimisation.
(cherry picked from commit 464ef17bcbf634ae33b37672a5b803f0ce940086)
Stackless contains a few places, where it has to prevent overly compiler optimisation for the following reasons:
Currently Stackless writes the address of the object / a dummy value to a global variable with external linkage. This works as long as the compiler/linker can't optimise away this variable. A conventional compile, then link tool chain can't do this, but a tool chain with whole program optimisation can. Pull request #163 reports such a problem and issue #173 might also be caused by whole program optimisation. Linux is not affected, because ELF requires that a variable with external linkage can be dynamically linked at run time.
Plan: use pull request #163 and the code available at https://github.com/facebook/folly/blob/master/folly/Benchmark.h to write a portable macro, that acts as a sink for a pointer variable.
The text was updated successfully, but these errors were encountered: