]> gcc.gnu.org Git - gcc.git/commit
openmp: Fix placement of 2nd+ preparation statement for PHIs in simd clone lowering...
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 May 2020 07:51:05 +0000 (09:51 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 16 Sep 2020 17:34:12 +0000 (19:34 +0200)
commitb78ea59edbd354fed914d0f8eb78109db7316ce8
tree3af62afc11f676ac444d69eb879d107eb5de83c4
parent9d01f91514f627590adc408ac9a35a7153123119
openmp: Fix placement of 2nd+ preparation statement for PHIs in simd clone lowering [PR95108]

For normal stmts, preparation statements are inserted before the stmt, so if we need multiple,
they are in the correct order, but for PHIs we emit them after labels in the entry successor
bb, and we used to emit them in the reverse order that way.

2020-05-14  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/95108
* omp-simd-clone.c (struct modify_stmt_info): Add after_stmt member.
(ipa_simd_modify_stmt_ops): For PHIs, only add before first stmt in
entry block if info->after_stmt is NULL, otherwise add after that stmt
and update it after adding each stmt.
(ipa_simd_modify_function_body): Initialize info.after_stmt.

* gcc.dg/gomp/pr95108.c: New test.

(cherry picked from commit d0fb9ffc1b8f3b86bbdf0e915cec2136141b329b)
gcc/omp-simd-clone.c
gcc/testsuite/gcc.dg/gomp/pr95108.c [new file with mode: 0644]
This page took 0.060542 seconds and 6 git commands to generate.