2011-08-02 Daniel Kraft <d@domob.eu>
PR fortran/49885
* trans-array.c (gfc_trans_auto_array_allocation): Change
gfc_start_block to gfc_init_block to avoid spurious extra-scope.
2011-08-02 Daniel Kraft <d@domob.eu>
PR fortran/49885
* gfortran.dg/auto_char_dummy_array_3.f90: New test.
From-SVN: r177211
+2011-08-02 Daniel Kraft <d@domob.eu>
+
+ PR fortran/49885
+ * trans-array.c (gfc_trans_auto_array_allocation): Change
+ gfc_start_block to gfc_init_block to avoid spurious extra-scope.
+
2011-08-02 Tobias Burnus <burnus@net-b.de>
* trans-array.c (gfc_array_allocate): Pass token to
gcc_assert (GFC_ARRAY_TYPE_P (type));
onstack = TREE_CODE (type) != POINTER_TYPE;
- gfc_start_block (&init);
+ gfc_init_block (&init);
/* Evaluate character string length. */
if (sym->ts.type == BT_CHARACTER
+2011-08-02 Daniel Kraft <d@domob.eu>
+
+ PR fortran/49885
+ * gfortran.dg/auto_char_dummy_array_3.f90: New test.
+
2011-08-02 Kai Tietz <ktietz@redhat.com>
PR middle-end/49947
--- /dev/null
+! { dg-do run }
+
+! PR fortran/49885
+! Check that character arrays with non-constant char-length are handled
+! correctly.
+
+! Contributed by Daniel Kraft <d@domob.eu>,
+! based on original test case and variant by Tobias Burnus in comment 2.
+
+PROGRAM main
+ IMPLICIT NONE
+
+ CALL s (10)
+
+CONTAINS
+
+ SUBROUTINE s (nb)
+ INTEGER :: nb
+ CHARACTER(MAX (80, nb)) :: bad_rec(1)
+
+ bad_rec(1)(1:2) = 'abc'
+ IF (bad_rec(1)(1:2) /= 'ab') CALL abort ()
+ END SUBROUTINE s
+
+END PROGRAM main