-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"openmprelease:mergedrelease:reviewed
Milestone
Description
In the following test the loop executes one more time than expected:
void unroll_partial_remainder(int *A)
{
#pragma omp parallel for
#pragma omp unroll partial(4)
for (int i = 0; i < 12; ++i)
A[i] = i;
}
#include <stdio.h>
#include <assert.h>
int main() {
int A[24];
for(int i = 0; i<24; i++){ A[i]=0; }
// write 12 elements 0 thru 11.
unroll_partial_remainder(A);
// Off by one?
assert(A[12] == 0);
return 0;
}$ clang -fopenmp -fopenmp-version=51 u.c && ./a.out
a.out: u.c:21: int main(): Assertion `A[12] == 0' failed.
Aborted (core dumped)
$ clang --version
clang version 15.0.0 (git@github.com:llvm/llvm-project ef87865b98fa25af1d2c045bab1268b2a1503374)
Target: x86_64-unknown-linux-gnuMetadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"openmprelease:mergedrelease:reviewed
Type
Projects
Status
Done