Skip to content

Commit

Permalink
[OMPT] Add Workaround for Intel Compiler Bug
Browse files Browse the repository at this point in the history
Add Workaround for Intel Compiler Bug with Case#: 03138964

A critical region within a nested task causes a segfault in icc 14-18:

int main()
{
  #pragma omp parallel num_threads(2)
  #pragma omp master
    #pragma omp task
      #pragma omp task
        #pragma omp critical
          printf("test\n");
}
When the critical region is in a separate function, the segault does not occur.
So we add noinline to make sure that the function call stays there.

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

llvm-svn: 322622
  • Loading branch information
jprotze committed Jan 17, 2018
1 parent 1b2bd26 commit 0c9516b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/runtime/test/ompt/tasks/task_types.c
Expand Up @@ -4,7 +4,7 @@
#include <omp.h>
#include <math.h>


__attribute__ ((noinline)) // workaround for bug in icc
void print_task_type(int id)
{
#pragma omp critical
Expand Down
1 change: 1 addition & 0 deletions openmp/runtime/test/ompt/tasks/task_types_serialized.c
Expand Up @@ -4,6 +4,7 @@
#include "callback.h"
#include <omp.h>

__attribute__ ((noinline)) // workaround for bug in icc
void print_task_type(int id)
{
#pragma omp critical
Expand Down

0 comments on commit 0c9516b

Please sign in to comment.