re PR fortran/56052 ([OOP] ICE in omp_add_variable, at gimplify.c:5606)
authorJakub Jelinek <jakub@redhat.com>
Wed, 23 Jan 2013 08:43:50 +0000 (09:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 23 Jan 2013 08:43:50 +0000 (09:43 +0100)
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

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/pr56052.f90 [new file with mode: 0644]

index 144da72020b4104da40217c52c01fcd5f132cc75..6825ab111236489b8159539e265914c22739fb47 100644 (file)
@@ -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
index 1f51d6a90a5dee4c3aa7c4788647d35c63a2fb99..26103a3b27e1d71ba9f1806b40230196941ca213 100644 (file)
@@ -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
index 3b212630d8bd5bc627863217757412d87f41cf96..4914fafa42abe945bb46c0d7a3f00a6330017c92 100644 (file)
@@ -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 (file)
index 0000000..dc3de71
--- /dev/null
@@ -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