-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

after a loooong while, here's another patch from me.  It is a one-line
fix for PR 49885, which was introduced by me last year.  While the patch
should be simple, it wasn't that easy to find the fix (for me at least)
... but I think it should be fairly easy to see now.  For some kind of
analysis, you can look at my comments in the PR.

No regressions on x86_64-unknown-linux-gnu.  Ok for trunk?

Yours,
Daniel

- -- 
OpenPGP: 3BA2 3DDB 7758 F010 BDAB 0DCF 527E 79BA A3B5 3998
or use https://safesend.domob.eu/
- --
Done:  Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOOFbzAAoJEFJ+ebqjtTmYL/0P/2cEE8FmVSYsBLxK6sy4129X
UPbcA8aaKDFjIONrFz98nPZcrw6ph/AYe7mOsQ+K+wx2gsPXHV7L1tx77MAb4Snv
M262pfm5I+y9xup3QYy85y4+7N9o2eqmNiV519ogEugtYzZncfMFOeohG2IiQVBr
F9uvc9NS4wT6pyUVhilYN/s6C9LmVQw7U003NjD6yK01e7RBWLTY4eUKtpruehMM
OIZLVC1iIfyeDNzjAzIwzwvQd2IeINS5iIJCRblYEPrbPYyoWfZ3tUACzddV3Axc
7fIAd247NxQA6s6Vjqa0iMRc2ObCRmxhKfyt1Q3IN3PMAFs80p5BZ0aMEw1CJpNj
fU4j9kpiyNd0onJ/3Z8RqFGAuXI1qW1AyitY9KBVLGH9XI7FG7uUR02qnSD1z15Z
X2DwW8obD8xxDskbPWGohgUV8vFVQHGNatThgnDBOUquL4ZHvTaWiYPRiAcgq+1F
RUZMWQm6rcCR9GkrfDytcq7lupkNN/0QROmmRUtBlkH4/QV52YaIa6YeiX8L6Ebk
o1sAm+rn9oldEBySykaKAVT2Sbhfz+IKp6rbE7Js1mIoNmbtFDpQA1AE0APNZvrh
JHgWLqxtbqMmMQ08YNk/mUXoXRboK1FoPLKiw3fWhKHEldlJHjeW8RrkBPFOzjAX
0UyNefZsrE0ziuWOAEvE
=hjnD
-----END PGP SIGNATURE-----
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.
Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c   (revision 176950)
+++ gcc/fortran/trans-array.c   (working copy)
@@ -4882,7 +4882,7 @@
   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
Index: gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90       (revision 0)
+++ gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90       (revision 0)
@@ -0,0 +1,25 @@
+! { 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

Attachment: patch.changelog.sig
Description: Binary data

Attachment: patch.diff.sig
Description: Binary data

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to