]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/60881 (ICE on dummy argument that extends a type with scalar and scalar...
authorTobias Burnus <burnus@net-b.de>
Tue, 22 Apr 2014 19:28:43 +0000 (21:28 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 22 Apr 2014 19:28:43 +0000 (21:28 +0200)
2014-04-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/60881
        * trans-expr.c (gfc_trans_subcomponent_assign): Fix handling
        of scalar coarrays.

2014-04-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/60881
        * coarray/alloc_comp_3.f90: New.

From-SVN: r209657

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray/alloc_comp_3.f90 [new file with mode: 0644]

index d2b666040d0953c9b8ba240c92c83f95c222476a..427c9b15ad85ad28aeb3291d39c355cf805dfdc7 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-22  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/60881
+       * trans-expr.c (gfc_trans_subcomponent_assign): Fix handling
+       of scalar coarrays.
+
 2014-04-17  Jakub Jelinek  <jakub@redhat.com>
 
        * trans-types.c (gfc_init_kinds): Make sure GET_MODE_BITSIZE
index 955102b042e12ff827c1aab20bc75a62d07c2422..d6f820c491589c6ec1cc89e16120362d5e02a06f 100644 (file)
@@ -5989,7 +5989,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
     {
       gfc_init_se (&se, NULL);
       /* Pointer component.  */
-      if (cm->attr.dimension && !cm->attr.proc_pointer)
+      if ((cm->attr.dimension || cm->attr.codimension)
+         && !cm->attr.proc_pointer)
        {
          /* Array pointer.  */
          if (expr->expr_type == EXPR_NULL)
@@ -6026,7 +6027,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
                                        gfc_class_initializer (&cm->ts, expr));
       gfc_add_expr_to_block (&block, tmp);
     }
-  else if (cm->attr.dimension && !cm->attr.proc_pointer)
+  else if ((cm->attr.dimension || cm->attr.codimension)
+          && !cm->attr.proc_pointer)
     {
       if (cm->attr.allocatable && expr->expr_type == EXPR_NULL)
        gfc_conv_descriptor_data_set (&block, dest, null_pointer_node);
index 357847004dfaef73d6be329e9cf3ed98c91afa63..9d0ef96d93a261b9caaba6676e650bbb8f0a1e2c 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-22  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/60881
+       * coarray/alloc_comp_3.f90: New.
+
 2014-04-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/60868
diff --git a/gcc/testsuite/gfortran.dg/coarray/alloc_comp_3.f90 b/gcc/testsuite/gfortran.dg/coarray/alloc_comp_3.f90
new file mode 100644 (file)
index 0000000..cf2d542
--- /dev/null
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+! PR fortran/60881
+!
+! Contributed by Damian Rouson
+!
+! Was ICEing before
+!
+program main
+  implicit none
+  type co_object
+    logical :: defined=.false.
+    real, allocatable :: dummy_to_facilitate_extension[:]
+  end type
+  type, extends(co_object) :: global_field
+  end type
+  type(global_field) T
+  call assign_local_field(T)
+contains
+  subroutine assign_local_field(lhs)
+    type(global_field) lhs
+  end subroutine
+end program