This is an archive of the discontinued LLVM Phabricator instance.

[OMPT] Add Workaround for Intel Compiler Bug
ClosedPublic

Authored by sconvent on Dec 13 2017, 6:32 AM.

Details

Summary

Add Workaround for Intel Compiler Bug with Case#: 03138964

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

#include <stdio.h>
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.

Diff Detail

Repository
rL LLVM

Event Timeline

sconvent created this revision.Dec 13 2017, 6:32 AM
sconvent retitled this revision from [ OMPT] Fix testcases for Intel Compiler to [OMPT] Fix testcases for Intel Compiler.
sconvent added a subscriber: openmp-commits.

icc bug

What bug it is and which version of ICC is affected?

icc bug

What bug it is and which version of ICC is affected?

Yes, this change also deserves a description of why this is needed. It also looks like the fuzzy address and noinline are two different problems that should be addressed separately.

runtime/test/ompt/tasks/task_types.c
15 ↗(On Diff #126754)

This should not be needed, format_task_type uses sprintf which automatically appends a null character.

runtime/test/ompt/tasks/task_types_serialized.c
14 ↗(On Diff #126754)

Same

icc bug

What bug it is and which version of ICC is affected?

We found that

#include <stdio.h>
int main()
{
  #pragma omp parallel num_threads(2)
  #pragma omp master
    #pragma omp task
      #pragma omp task
        #pragma omp critical
          printf("test\n");
}

results in a segfault. icc 14-18 are affected. Paul Kapinos opened a ticket with Intel for this bug.
There is no segfault if the critical is in a function. Therefore we added the noinline for print_task_type.

@omalyshe AFAIK this issue is Case#: 03138964

sconvent updated this revision to Diff 129233.Jan 10 2018, 3:41 AM
sconvent retitled this revision from [OMPT] Fix testcases for Intel Compiler to [OMPT] Add Workaround for Intel Compiler Bug.
sconvent edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 11 2018, 1:37 AM
This revision was automatically updated to reflect the committed changes.