https://bugs.llvm.org/show_bug.cgi?id=46426
Bug ID: 46426
Summary: [OpenMP5.0] Wrong behavior when use array sections in
map clauses on target and target data constructs
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Clang Compiler Support
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
In the examples below, clang has opposite behavior when compile:
These examples are from:
https://www.openmp.org/wp-content/uploads/openmp-examples-5.0.0.pdf
4.4 Array Sections in Device Constructs
According to the examples specification in the above url,
Example_array_sections.1.c should throw error,
Example_array_sections.3.c and,
Example_array_sections.4.c should not throw error,
but clang act opposite when compile, details are as below:
test case:
-----------------------------------
Example_array_sections.1.c
void foo ()
{
int A[30];
#pragma omp target data map( A[0:4] )
{
/* Cannot map distinct parts of the same array */
#pragma omp target map( A[7:20] )
{
A[2] = 0;
}
}
}
Example_array_sections.3.c
void foo ()
{
int A[30], *p;
#pragma omp target data map( A[0:4] )
{
p = &A[0];
#pragma omp target map( p[7:20] )
{
A[2] = 0;
p[8] = 0;
}
}
}
Example_array_sections.4.c
void foo ()
{
int A[30], *p;
#pragma omp target data map( A[0:10] )
{
p = &A[0];
#pragma omp target map( p[3:7] )
{
A[2] = 0;
p[8] = 0;
A[8] = 1;
}
}
}
test command:
------------------
# clang --version
clang version 10.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
# clang -fopenmp-version=50 -fopenmp -S Example_array_sections.1.c
# clang -fopenmp-version=50 -fopenmp -S Example_array_sections.3.c
Example_array_sections.3.c:16:7: error: original storage of expression in data
environment is shared but data environment do not fully contain mapped
expression storage
A[2] = 0;
^
Example_array_sections.3.c:11:30: note: used here
#pragma omp target data map( A[0:4] )
^~~~~~
1 error generated.
]# clang -fopenmp-version=50 -fopenmp -S Example_array_sections.4.c
Example_array_sections.4.c:16:7: error: original storage of expression in data
environment is shared but data environment do not fully contain mapped
expression storage
A[2] = 0;
^
Example_array_sections.4.c:11:30: note: used here
#pragma omp target data map( A[0:10] )
^~~~~~~
1 error generated.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs