Commit c31bc4ac by Tom de Vries Committed by Tom de Vries

[openacc] Fix diff_type in expand_oacc_collapse_init

2018-02-07  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/84217
	* omp-expand.c (expand_oacc_collapse_init): Ensure diff_type is large
	enough.

	* c-c++-common/goacc/pr84217.c: New test.
	* gfortran.dg/goacc/pr84217.f90: New test.

	* testsuite/libgomp.oacc-c-c++-common/pr84217.c: New test.

From-SVN: r257443
parent 26a823f0
2018-02-07 Tom de Vries <tom@codesourcery.com>
PR libgomp/84217
* omp-expand.c (expand_oacc_collapse_init): Ensure diff_type is large
enough.
2018-02-07 Richard Biener <rguenther@suse.de> 2018-02-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/84204 PR tree-optimization/84204
......
...@@ -1433,6 +1433,8 @@ expand_oacc_collapse_init (const struct omp_for_data *fd, ...@@ -1433,6 +1433,8 @@ expand_oacc_collapse_init (const struct omp_for_data *fd,
plus_type = sizetype; plus_type = sizetype;
if (POINTER_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type)) if (POINTER_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type))
diff_type = signed_type_for (diff_type); diff_type = signed_type_for (diff_type);
if (TYPE_PRECISION (diff_type) < TYPE_PRECISION (integer_type_node))
diff_type = integer_type_node;
if (tiling) if (tiling)
{ {
......
2018-02-07 Tom de Vries <tom@codesourcery.com>
PR libgomp/84217
* c-c++-common/goacc/pr84217.c: New test.
* gfortran.dg/goacc/pr84217.f90: New test.
2018-02-07 Richard Biener <rguenther@suse.de> 2018-02-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/84204 PR tree-optimization/84204
......
void
foo (void)
{
#pragma acc parallel loop tile (2, 3)
for (short i = 0; i < 10; ++i)
for (short j = 0; j < 10; ++j)
;
}
subroutine foo
integer(2) :: i, j
!$acc parallel loop tile(2,3)
do i = 1, 10
do j = 1, 10
end do
end do
!$acc end parallel loop
end
2018-02-07 Tom de Vries <tom@codesourcery.com>
PR libgomp/84217
* testsuite/libgomp.oacc-c-c++-common/pr84217.c: New test.
2018-01-29 Christoph Spiel <cspiel@freenet.de> 2018-01-29 Christoph Spiel <cspiel@freenet.de>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
extern void abort (void);
#define N 10
int
main (void)
{
int a[N];
for (short i = 0; i < N; ++i)
a[i] = -1;
#pragma acc parallel loop tile (2)
for (short i = 0; i < N; ++i)
a[i] = i;
for (short i = 0; i < N; ++i)
if (a[i] != i)
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