re PR fortran/57093 (Seg fault on internal output to a character scalar coarray)
authorTobias Burnus <burnus@gcc.gnu.org>
Sun, 28 Apr 2013 19:54:44 +0000 (21:54 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Sun, 28 Apr 2013 19:54:44 +0000 (21:54 +0200)
2013-04-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57093
        * trans-types.c (gfc_get_element_type): Fix handling
        of scalar coarrays of type character.
        * intrinsic.texi (PACK): Add missing ")".

2013-04-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57093
        * gfortran.dg/coarray_30.f90: New.

From-SVN: r198379

gcc/fortran/ChangeLog
gcc/fortran/intrinsic.texi
gcc/fortran/trans-types.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_30.f90 [new file with mode: 0644]

index 9debee4adc5b0dfa0ef4c51ce641f91f681ea1f2..5536f5d5eca44d39024b83f7e5e9a2cb914fba69 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/57093
+       * trans-types.c (gfc_get_element_type): Fix handling
+       of scalar coarrays of type character.
+       * intrinsic.texi (PACK): Add missing ")".
+
 2013-04-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/57071
@@ -6,9 +13,9 @@
 
 2013-04-25  Janne Blomqvist  <jb@gcc.gnu.org>
 
-        PR bootstrap/57028
-        * Make-lang.in (f951): Link in ZLIB.
-        (CFLAGS-fortran/module.o): Add zlib include directory.
+       PR bootstrap/57028
+       * Make-lang.in (f951): Link in ZLIB.
+       (CFLAGS-fortran/module.o): Add zlib include directory.
 
 2013-04-22  Janus Weil  <janus@gcc.gnu.org>
 
index ed464a6ee720495945b9f93cd4aa7b0592601014..63c352c1dd422250e80388493412540619f08f1f 100644 (file)
@@ -9619,7 +9619,7 @@ Fortran 95 and later
 Transformational function
 
 @item @emph{Syntax}:
-@code{RESULT = PACK(ARRAY, MASK[,VECTOR]}
+@code{RESULT = PACK(ARRAY, MASK[,VECTOR])}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
index 379fe9463f07415f2beabcf6ccc2081dd39a56f8..806accc7015a76ca05fe05edfe03cdfad6b70fe2 100644 (file)
@@ -1179,7 +1179,7 @@ gfc_get_element_type (tree type)
       element = TREE_TYPE (element);
 
       /* For arrays, which are not scalar coarrays.  */
-      if (TREE_CODE (element) == ARRAY_TYPE)
+      if (TREE_CODE (element) == ARRAY_TYPE && !TYPE_STRING_FLAG (element))
        element = TREE_TYPE (element);
     }
 
index 41b155c8ce182f628c5e8653106373f79a09a796..36ce9f0f06bc9538b97325c1a1e9fb42e98ed84e 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/57093
+       * gfortran.dg/coarray_30.f90: New.
+
 2013-04-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/57071
@@ -43,7 +48,7 @@
 2013-04-25  Marek Polacek  <polacek@redhat.com>
 
        PR tree-optimization/57066
-        * gcc.dg/torture/builtin-logb-1.c: Adjust testcase.
+       * gcc.dg/torture/builtin-logb-1.c: Adjust testcase.
 
 2013-04-25  James Greenhalgh  <james.greenhalgh@arm.com>
            Tejas Belagod  <tejas.belagod@arm.com>
diff --git a/gcc/testsuite/gfortran.dg/coarray_30.f90 b/gcc/testsuite/gfortran.dg/coarray_30.f90
new file mode 100644 (file)
index 0000000..2cfb50a
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single -fdump-tree-original" }
+!
+! PR fortran/57093
+!
+! Contributed by Damian Rouson
+!
+program main
+  character(len=25), allocatable :: greeting[:]
+  allocate(greeting[*])
+  write(greeting,"(a)") "z"
+end
+
+! { dg-final { scan-tree-dump-times "greeting.data = \\(void . restrict\\) __builtin_malloc \\(25\\);" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }