aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-01-23 09:43:50 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-01-23 09:43:50 +0100
commitb39968989d6ae4289c01202c45268b5651d1c222 (patch)
tree37ea5f2a61404a12a6996175537607da56e7b4f8 /gcc
parenta70418fc91b353d0658b561aaf3990088cb47a8d (diff)
downloadgcc-b39968989d6ae4289c01202c45268b5651d1c222.zip
gcc-b39968989d6ae4289c01202c45268b5651d1c222.tar.gz
gcc-b39968989d6ae4289c01202c45268b5651d1c222.tar.bz2
re PR fortran/56052 ([OOP] ICE in omp_add_variable, at gimplify.c:5606)
PR fortran/56052 * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P on select_type_temporary and don't set DECL_BY_REFERENCE. * gfortran.dg/gomp/pr56052.f90: New test. From-SVN: r195399
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-decl.c9
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr56052.f9016
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 144da72..6825ab1 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/56052
+ * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
+ and DECL_IGNORED_P on select_type_temporary and don't set
+ DECL_BY_REFERENCE.
+
2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55919
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 1f51d6a..26103a3 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1397,6 +1397,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
DECL_IGNORED_P (decl) = 1;
}
+ if (sym->attr.select_type_temporary)
+ {
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
+ }
+
if (sym->attr.dimension || sym->attr.codimension)
{
/* Create variables to hold the non-constant bits of array info. */
@@ -1496,7 +1502,8 @@ gfc_get_symbol_decl (gfc_symbol * sym)
&& POINTER_TYPE_P (TREE_TYPE (decl))
&& !sym->attr.pointer
&& !sym->attr.allocatable
- && !sym->attr.proc_pointer)
+ && !sym->attr.proc_pointer
+ && !sym->attr.select_type_temporary)
DECL_BY_REFERENCE (decl) = 1;
if (sym->attr.vtab
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3b21263..4914faf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2013-01-23 Jakub Jelinek <jakub@redhat.com>
+ PR fortran/56052
+ * gfortran.dg/gomp/pr56052.f90: New test.
+
PR target/49069
* gcc.dg/pr49069.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr56052.f90 b/gcc/testsuite/gfortran.dg/gomp/pr56052.f90
new file mode 100644
index 0000000..dc3de71
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr56052.f90
@@ -0,0 +1,16 @@
+! PR fortran/56052
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+subroutine middle(args)
+ type args_t
+ end type
+ type, extends(args_t) :: scan_args_t
+ end type
+ class(args_t),intent(inout) :: args
+ !$omp single
+ select type (args)
+ type is (scan_args_t)
+ end select
+ !$omp end single
+end subroutine middle