[OMPT] Use alloca() to force availability of frame pointer

When compiling with icc, there is a problem with reenter frame addresses in
parallel_begin callbacks in the interoperability.c testcase. (The address is
not available. thus NULL)
Using alloca() forces availability of the frame pointer.

Patch provided by Simon Convent

Differential Revision: https://reviews.llvm.org/D48282

llvm-svn: 336088
This commit is contained in:
Joachim Protze
2018-07-02 09:13:38 +00:00
parent e2eec57a4f
commit 04a00fc18c

View File

@@ -3,6 +3,7 @@
#include <iostream>
#include <thread>
#include <alloca.h>
#include "callback.h"
#include "omp.h"
@@ -15,6 +16,9 @@ void f() {
// runtime isn't initialized yet...)
omp_get_num_threads();
// Call alloca() to force availability of frame pointer
void *p = alloca(0);
OMPT_SIGNAL(condition);
// Wait for both initial threads to arrive that will eventually become the
// master threads in the following parallel region.