This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/84234] #pragma omp declare simd is ignored on forward declaration
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Feb 2018 11:34:35 +0000
- Subject: [Bug middle-end/84234] #pragma omp declare simd is ignored on forward declaration
- Auto-submitted: auto-generated
- References: <bug-84234-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84234
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The forward declaration is not ignored, but you either need to use #pragma omp
simd on the loop you want to vectorize, or tell the compiler your function
doesn't have any side-effects that would prevent auto-vectorization.
By using #pragma omp simd, you guarantee it yourself in the caller, by using
e.g. const attribute on the function.
The restrictions on #pragma omp declare simd marked functions only talk about
SIMD regions which you aren't using, so I don't see how we can derive anything
from it for other regions.