openmp: Make finalize_task_copyfn order reproduceable [PR104517]
authorJakub Jelinek <jakub@redhat.com>
Tue, 15 Feb 2022 09:22:30 +0000 (10:22 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 15 Feb 2022 09:22:30 +0000 (10:22 +0100)
commit6a0d6e7ca9b9e338e82572db79c26168684a7441
tree27dd704fd392c491ede77c75bdf6834799e37649
parent2c3309e3d0f5cb8f298f7604848d115f0992e04f
openmp: Make finalize_task_copyfn order reproduceable [PR104517]

The following testcase fails -fcompare-debug, because finalize_task_copyfn
was invoked from splay tree destruction, whose order can in some cases
depend on -g/-g0.  The fix is to queue the task stmts that need copyfn
in a vector and run finalize_task_copyfn on elements of that vector.

2022-02-15  Jakub Jelinek  <jakub@redhat.com>

PR debug/104517
* omp-low.cc (task_cpyfns): New variable.
(delete_omp_context): Don't call finalize_task_copyfn from here.
(create_task_copyfn): Push task_stmt into task_cpyfns.
(execute_lower_omp): Call finalize_task_copyfn here on entries from
task_cpyfns vector and release the vector.

* gcc.dg/gomp/pr104517.c: New test.
gcc/omp-low.cc
gcc/testsuite/gcc.dg/gomp/pr104517.c [new file with mode: 0644]