Currently, OMPT works around the issue of internal calls to the kmpc interface, because we need to collect frame and return address on entry to the runtime.
This patch adds __kmp_aux_ variants for all internally called __kmpc_ functions and replaces all internal calls, so that only compiler generated code will call the external kmpc interface.
The KMP_ASSERT in the return address guard now successfully shows that no return address is temporarily stored when we try to store a new address on entering the runtime. I'll replace the assert by KMP_DEBUG_ASSERT.
In my adhoc tests with epcc benchmarks I didn't see performance regressions from this patch, but I recommend to run your own regression tests.
This refactoring will allow more consistent handling of OMPT frame and state information in the next step.