Commit d41d952c by Tom de Vries Committed by Tom de Vries

[nvptx] Handle assignment to gang-level reduction variable

2019-01-15  Tom de Vries  <tdevries@suse.de>

	PR target/80547
	* config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Handle
	lhs == NULL_TREE for gang-level reduction.

	* testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c:
	New test.

From-SVN: r267934
parent 4882e5ba
2019-01-15 Tom de Vries <tdevries@suse.de>
PR target/80547
* config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Handle
lhs == NULL_TREE for gang-level reduction.
2019-01-15 Richard Biener <rguenther@suse.de> 2019-01-15 Richard Biener <rguenther@suse.de>
Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
......
...@@ -6242,7 +6242,8 @@ nvptx_goacc_reduction_init (gcall *call, offload_attrs *oa) ...@@ -6242,7 +6242,8 @@ nvptx_goacc_reduction_init (gcall *call, offload_attrs *oa)
init = var; init = var;
} }
gimplify_assign (lhs, init, &seq); if (lhs != NULL_TREE)
gimplify_assign (lhs, init, &seq);
} }
pop_gimplify_context (NULL); pop_gimplify_context (NULL);
......
2019-01-15 Tom de Vries <tdevries@suse.de>
PR target/80547
* testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c:
New test.
2019-01-12 Tom de Vries <tdevries@suse.de> 2019-01-12 Tom de Vries <tdevries@suse.de>
* testsuite/libgomp.oacc-c-c++-common/pr85486-2.c: New test. * testsuite/libgomp.oacc-c-c++-common/pr85486-2.c: New test.
......
/* { dg-xfail-run-if "PR88852" { openacc_host_selected } } */
int
main (void)
{
int x = 123;
#pragma acc parallel num_gangs(1) reduction (+: x)
{
x = 23;
}
if (x != 146)
__builtin_abort();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment