]> git.ipfire.org Git - thirdparty/gcc.git/commit
Permit calls to builtins and intrinsics in kernels loops.
authorSandra Loosemore <sandra@codesourcery.com>
Sun, 23 Aug 2020 01:23:26 +0000 (18:23 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:28 +0000 (14:11 +0100)
commitb813e919ddc1eecb2e2c28002e775c2aecddd708
treeb1730337034e9f41c08a9d1ccd4d72f12102bf95
parent69e65667549c7e323f02b52d9579ee094d123732
Permit calls to builtins and intrinsics in kernels loops.

This tweak to the OpenACC kernels loop annotation relaxes the
restrictions on function calls in the loop body.  Normally calls to
functions not explicitly marked with a parallelism attribute are not
permitted, but C/C++ builtins and Fortran intrinsics have known
semantics so we can generally permit those without restriction.  If
any turn out to be problematical, we can add on here to recognize
them, or in the processing of the "auto" annotations.

2020-08-22  Sandra Loosemore  <sandra@codesourcery.com>

gcc/c-family/
* c-omp.cc (annotate_loops_in_kernels_regions): Test for
calls to builtins.

gcc/fortran/
* openmp.cc (check_expr_for_invalid_calls): Check for intrinsic
functions.

gcc/testsuite/
* c-c++-common/goacc/kernels-loop-annotation-20.c: New.
* gfortran.dg/goacc/kernels-loop-annotation-20.f95: New.
gcc/c-family/ChangeLog.omp
gcc/c-family/c-omp.cc
gcc/fortran/ChangeLog.omp
gcc/fortran/openmp.cc
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/goacc/kernels-loop-annotation-20.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/goacc/kernels-loop-annotation-20.f95 [new file with mode: 0644]