aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-08-19 17:27:40 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-08-19 17:27:40 +0200
commit94e73c786980bd8b84c935952a05e02b9c55e05b (patch)
tree973d03c991632786f2ef3561aa0597497fc66184 /gcc/testsuite
parentb5fd0b71fe74d11f37e6f679d3e72bad23b82aa7 (diff)
downloadgcc-94e73c786980bd8b84c935952a05e02b9c55e05b.zip
gcc-94e73c786980bd8b84c935952a05e02b9c55e05b.tar.gz
gcc-94e73c786980bd8b84c935952a05e02b9c55e05b.tar.bz2
re PR fortran/69281 (gfortran ICE on temporary array in function call with -fstack-arrays -fopenmp)
PR fortran/69281 * trans-openmp.c (gfc_trans_omp_parallel, gfc_trans_omp_task, gfc_trans_omp_target): Wrap gfc_trans_omp_code result in an extra BIND_EXPR with its own forced BLOCK. * gfortran.dg/gomp/pr69281.f90: New test. From-SVN: r239618
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr69281.f9063
2 files changed, 68 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3807dd5..a4ae65d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/69281
+ * gfortran.dg/gomp/pr69281.f90: New test.
+
2016-08-19 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.dg/random_4.f90: Initialize seed before using, handle
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr69281.f90 b/gcc/testsuite/gfortran.dg/gomp/pr69281.f90
new file mode 100644
index 0000000..f323484
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr69281.f90
@@ -0,0 +1,63 @@
+! PR fortran/69281
+! { dg-do compile }
+! { dg-additional-options "-fstack-arrays -O2" }
+
+program pr69281
+ implicit none
+ call foo1((/ 1, 3, 3, 7 /))
+ call foo2((/ 1, 3, 3, 7 /))
+ call foo3((/ 1, 3, 3, 7 /))
+ call foo4((/ 1, 3, 3, 7 /))
+ call foo5((/ 1, 3, 3, 7 /))
+ call foo6((/ 1, 3, 3, 7 /))
+contains
+ subroutine foo1(x)
+ integer, intent(in) :: x(:)
+ !$omp parallel
+ call baz(bar(x))
+ !$omp end parallel
+ end subroutine
+ subroutine foo2(x)
+ integer, intent(in) :: x(:)
+ !$omp task
+ call baz(bar(x))
+ !$omp end task
+ end subroutine
+ subroutine foo3(x)
+ integer, intent(in) :: x(:)
+ !$omp target
+ call baz(bar(x))
+ !$omp end target
+ end subroutine
+ subroutine foo4(x)
+ integer, intent(in) :: x(:)
+ !$omp target teams
+ call baz(bar(x))
+ !$omp end target teams
+ end subroutine
+ subroutine foo5(x)
+ integer, intent(in) :: x(:)
+ integer :: i
+ !$omp parallel do
+ do i = 1, 1
+ call baz(bar(x))
+ end do
+ end subroutine
+ subroutine foo6(x)
+ integer, intent(in) :: x(:)
+ integer :: i
+ !$omp target teams distribute parallel do
+ do i = 1, 1
+ call baz(bar(x))
+ end do
+ end subroutine
+ function bar(x) result(a)
+ integer, dimension(:), intent(in) :: x
+ integer, dimension(2,size(x)) :: a
+ a(1,:) = 1
+ a(2,:) = x
+ end function
+ subroutine baz(a)
+ integer, dimension(:,:), intent(in) :: a
+ end subroutine
+end program