Technical data
#pragma Directives [3]
}
/* The following tasks because the cncall directive */
/* allows the compiler to assume no loop carried */
/* dependence to/from any call-by-reference argument. */
/* unfortunately, x is socped shared, which is */
/* most likely not what the user expects. */
#pragma _CRI cncall
for (k = 0; k < ke; ++k) {
tskvalue(&x);
itask = x + 1;
}
}
Because the compiler cannot know how a subroutine will use its formal
parameters, the compiler must make an educated guess when the cncall
directive is applied. For some codes, the compiler’s guess will not agree with
user requirements. For such codes, explicit variable scoping directives are
required.
Subroutine amb, in example 3, illustrates another subtle pitfall:
void
amb(int n, float a[n])
{
int k;
#pragma _CRI cncall
for (k = 0; k < n; ++k) {
s1(a, k);
s2(a, k);
}
}
In example 3, a is a pointer that is scoped value by the compiler. So array a is
effectively shared.Ifs1 and s2 only access a[k] during iteration k, it is correct
to scope a as shared. Likewise, if s1 and s2 never modify a, a must be scoped
as shared. It would be incorrect to scope a as private. However, if s1 were
to define all the elements of the array a, then array a would need to be scoped
as private, which cannot be done in C or C++ because the name a denotes a
pointer to the array, not the array itself.
cncall directs the compiler to ignore ambiguous dependencies involving
function and subroutine calls within the loop that follows. This may lead to
S–2179–36 69










