Hi!

For is_simd, we change GIMPLE_OMP_SCAN statements immediately to GIMPLE_NOPs
and emit their bodies after them, so the lower_omp caller keeps iterating
over those statements, but for is_for we don't do that, so we should
lower_omp the bodies.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2019-07-04  Jakub Jelinek  <ja...@redhat.com>

        * omp-low.c (lower_omp_scan): Call lower_omp on stmt's body
        in worksharing loop scans.

--- gcc/omp-low.c.jj    2019-07-03 07:02:16.460989884 +0200
+++ gcc/omp-low.c       2019-07-03 21:02:10.097104445 +0200
@@ -8874,8 +8874,10 @@ lower_omp_scan (gimple_stmt_iterator *gs
       gsi_insert_seq_after (gsi_p, gimple_omp_body (stmt), GSI_SAME_STMT);
       gsi_insert_seq_after (gsi_p, before, GSI_SAME_STMT);
       gsi_replace (gsi_p, gimple_build_nop (), true);
+      return;
     }
-  else if (before)
+  lower_omp (gimple_omp_body_ptr (stmt), octx);
+  if (before)
     {
       gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (stmt));
       gsi_insert_seq_before (&gsi, before, GSI_SAME_STMT);

        Jakub

Reply via email to