]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
Backported from mainline
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Feb 2013 14:15:21 +0000 (14:15 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Feb 2013 14:15:21 +0000 (14:15 +0000)
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.

* gfortran.dg/gomp/pr56052.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@195662 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 68e9789b1f9a32de4f5b38960c8c8276fe013752..ed5c1a88ccfc8e3a0c638e6fd100c7c73739fc2b 100644 (file)
@@ -1,3 +1,13 @@
+2013-02-01  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       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-24  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/56081
index f225ab3b8c0f499ee0ccb33fca727f22c1bd790f..217eb4a08e60b30878df75986a0df5fd9a2a5b11 100644 (file)
@@ -1369,6 +1369,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.  */
@@ -1479,7 +1485,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 2d98efa893e3706fc34a7764e25282189e8ebc1e..c7903fa332b7aefb07ea5620c1688309bfcf2d0e 100644 (file)
@@ -3,6 +3,11 @@
        Backported from mainline
        2013-01-23  Jakub Jelinek  <jakub@redhat.com>
 
+       PR fortran/56052
+       * gfortran.dg/gomp/pr56052.f90: New test.
+
+       2013-01-23  Jakub Jelinek  <jakub@redhat.com>
+
        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