mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user