[Openmp-commits] [openmp] r336088 - [OMPT] Use alloca() to force availability of frame pointer

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 2 02:13:38 PDT 2018


Author: jprotze
Date: Mon Jul  2 02:13:38 2018
New Revision: 336088

URL: http://llvm.org/viewvc/llvm-project?rev=336088&view=rev
Log:
[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

Modified:
    openmp/trunk/runtime/test/ompt/misc/interoperability.cpp

Modified: openmp/trunk/runtime/test/ompt/misc/interoperability.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/misc/interoperability.cpp?rev=336088&r1=336087&r2=336088&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/misc/interoperability.cpp (original)
+++ openmp/trunk/runtime/test/ompt/misc/interoperability.cpp Mon Jul  2 02:13:38 2018
@@ -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.




More information about the Openmp-commits mailing list