Skip to content

Commit

Permalink
[OMPT] Use alloca() to force availability of frame pointer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jprotze committed Jul 2, 2018
1 parent e2eec57 commit 04a00fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openmp/runtime/test/ompt/misc/interoperability.cpp
Expand Up @@ -3,6 +3,7 @@

#include <iostream>
#include <thread>
#include <alloca.h>

#include "callback.h"
#include "omp.h"
Expand All @@ -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.
Expand Down

0 comments on commit 04a00fc

Please sign in to comment.