Remove fishy self-assignment in omp-low.c [PR94629]
authorFrederik Harwath <frederik@codesourcery.com>
Tue, 21 Apr 2020 10:36:14 +0000 (12:36 +0200)
committerFrederik Harwath <frederik@codesourcery.com>
Tue, 21 Apr 2020 13:12:05 +0000 (15:12 +0200)
commit15256c8a8ac6573d250506c40dbe13082186c2aa
tree08bb1a7a75b85246792c18c03475348c29f9bc40
parentac1a0a388cd9529b4ba8b10d8ccd8099a2a95b23
Remove fishy self-assignment in omp-low.c [PR94629]

The PR noticed that omp-low.c contains a self-assignment in the
function new_omp_context:

if (outer_ctx) {
    ...
    ctx->outer_reduction_clauses = ctx->outer_reduction_clauses;

This is obviously useless.  The original intention might have been
to copy the field from the outer_ctx to ctx.  Since this is done
(properly) in the only function where this field is actually used
(in function scan_omp_for) and the field is being initialized to zero
during the struct allocation, there is no need to attempt to do
anything to this field in new_omp_context. Thus this commit
removes any assignment to the field from new_omp_context.

2020-04-21  Frederik Harwath  <frederik@codesourcery.com>

PR other/94629
* gcc/omp-low.c (new_omp_context): Remove assignments to
ctx->outer_reduction_clauses and ctx->local_reduction_clauses.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
gcc/ChangeLog
gcc/omp-low.c