https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66862

            Bug ID: 66862
           Summary: OpenMP SIMD does not work (use SIMD instructions) on
                    conditional code
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bill.jordan at intel dot com
  Target Milestone: ---

Created attachment 35971
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35971&action=edit
SIMD sample code

In the following loop,the omp simd pragma has no affect:

 #pragma omp simd private(value) linear(ij, kj) safelen(64)
 for (j = 0; j < switches; ++j) {
     value = cost[ik] + cost[kj];
     if (value < cost[ij]) {
         cost[ij] = value;
     }
     ++ij; ++kj;
 }

Without the "if" clause, the compiler will generate SIMD code.

Compilation line is:
 gcc -Wall -Wextra -O3 -save-temps -fopenmp-simd -c floyds_simd.c

Attached source includes 4 routines:
 floyds_wo_omp_simd: Base function.
 floyds_w_omp_simd: Base function with #pragma omp simd directive
 not_floyds_wo_omp_simd: Base function without if clause
 not_floyds_w_omp_simd: Base function without if clause with #pragma omp simd

Reply via email to