diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-10-21 15:31:25 +0200 |
---|---|---|
committer | Kwok Cheung Yeung <kcy@codesourcery.com> | 2023-05-18 16:11:52 +0100 |
commit | 2dcca15948c5da11121f888ba0449bc56ba4af51 (patch) | |
tree | acca2d612a6589311d54da9f3151eacb081ac6f2 /gcc | |
parent | 44579e0298e281ec8902d4270eede9b1260d80f1 (diff) | |
download | gcc-2dcca15948c5da11121f888ba0449bc56ba4af51.zip gcc-2dcca15948c5da11121f888ba0449bc56ba4af51.tar.gz gcc-2dcca15948c5da11121f888ba0449bc56ba4af51.tar.bz2 |
omp-oacc-kernels-decompose.cc: fix -fcompare-debug with GIMPLE_DEBUG
GIMPLE_DEBUG were put in a parallel region of its own, which is not
only pointless but also breaks -fcompare-debug. With this commit,
they are handled like simple assignments: those placed are places
into the same body as the loop such that only one parallel region
remains as without debugging. This fixes the existing testcase
libgomp.oacc-c-c++-common/kernels-loop-g.c.
Note: GIMPLE_DEBUG are only accepted with -fcompare-debug; if they
appear otherwise, decompose_kernels_region_body rejects them with
a sorry (unchanged).
gcc/
* omp-oacc-kernels-decompose.cc (top_level_omp_for_in_stmt,
decompose_kernels_region_body): Handle GIMPLE_DEBUG like
simple assignment.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog.omp | 6 | ||||
-rw-r--r-- | gcc/omp-oacc-kernels-decompose.cc | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 2571310..5519c5c 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,9 @@ +2022-10-21 Tobias Burnus <tobias@codesourcery.com> + + * omp-oacc-kernels-decompose.cc (top_level_omp_for_in_stmt, + decompose_kernels_region_body): Handle GIMPLE_DEBUG like + simple assignment. + 2022-10-19 Tobias Burnus <tobias@codesourcery.com> * omp-expand.cc (expand_omp_target): Fix OpenACC in case there diff --git a/gcc/omp-oacc-kernels-decompose.cc b/gcc/omp-oacc-kernels-decompose.cc index d573e8c..02c89a9 100644 --- a/gcc/omp-oacc-kernels-decompose.cc +++ b/gcc/omp-oacc-kernels-decompose.cc @@ -120,7 +120,8 @@ top_level_omp_for_in_stmt (gimple *stmt) for (gsi = gsi_start (body); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple *body_stmt = gsi_stmt (gsi); - if (gimple_code (body_stmt) == GIMPLE_ASSIGN) + if (gimple_code (body_stmt) == GIMPLE_ASSIGN + || gimple_code (body_stmt) == GIMPLE_DEBUG) continue; else if (gimple_code (body_stmt) == GIMPLE_OMP_FOR && gsi_one_before_end_p (gsi)) @@ -1405,7 +1406,7 @@ decompose_kernels_region_body (gimple *kernels_region, tree kernels_clauses) = (gimple_code (stmt) == GIMPLE_ASSIGN && TREE_CODE (gimple_assign_lhs (stmt)) == VAR_DECL && DECL_ARTIFICIAL (gimple_assign_lhs (stmt))); - if (!is_simple_assignment) + if (!is_simple_assignment && gimple_code (stmt) != GIMPLE_DEBUG) only_simple_assignments = false; } } |