aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFeng Wang <fengwang@nudt.edu.cn>2006-07-11 04:09:40 +0000
committerFeng Wang <fengwang@gcc.gnu.org>2006-07-11 04:09:40 +0000
commit7b95e2a837bd2a1998223d900f71c9269870791e (patch)
treefa6737d047ee502674a0356051fd021ec1d664a9 /gcc
parentfb49f596ba1d71463d82929c8d542aa598343c75 (diff)
downloadgcc-7b95e2a837bd2a1998223d900f71c9269870791e.zip
gcc-7b95e2a837bd2a1998223d900f71c9269870791e.tar.gz
gcc-7b95e2a837bd2a1998223d900f71c9269870791e.tar.bz2
re PR fortran/28213 (ICE: Hollerith constant)
2006-07-11 Feng Wang <fengwang@nudt.edu.cn> PR fortran/28213 * gfortran.dg/hollerith4.f90: Test hollerith constants used in I/O list. 2006-07-11 Feng Wang <fengwang@nudt.edu.cn> PR fortran/28213 * trans-io.c (ransfer_expr): Deal with Hollerith constants used in I/O list. From-SVN: r115326
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-io.c1
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/hollerith4.f9021
4 files changed, 28 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a822228..87cfa48 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-11 Feng Wang <fengwang@nudt.edu.cn>
+
+ PR fortran/28213
+ * trans-io.c (ransfer_expr): Deal with Hollerith constants used in
+ I/O list.
+
2006-07-07 Kazu Hirata <kazu@codesourcery.com>
* intrinsic.texi: Fix typos.
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 6a0dac0..70b9368 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1700,6 +1700,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
break;
case BT_CHARACTER:
+ case BT_HOLLERITH:
if (se->string_length)
arg2 = se->string_length;
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9203c15..54af335 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-11 Feng Wang <fengwang@nudt.edu.cn>
+
+ PR fortran/28213
+ * gfortran.dg/hollerith4.f90: Test hollerith constants used in I/O
+ list.
+
2006-07-07 Lee Millward <lee.millward@gmail.com>
PR c++/27820
diff --git a/gcc/testsuite/gfortran.dg/hollerith4.f90 b/gcc/testsuite/gfortran.dg/hollerith4.f90
index b890185..bd2b411 100644
--- a/gcc/testsuite/gfortran.dg/hollerith4.f90
+++ b/gcc/testsuite/gfortran.dg/hollerith4.f90
@@ -1,5 +1,6 @@
! { dg-do run }
-! Test Hollerith constant assigned to allocatable array
+! Test Hollerith constants assigned to allocatable array
+! and used in I/O list.
integer, allocatable :: c (:,:)
character (len = 20) ch
@@ -14,16 +15,24 @@ write (ch, c) 'Hello'
if (ch .ne. "Hell") call abort()
write (ch, c (1,2)) 'Hello'
if (ch .ne. "Hello") call abort()
-end
-! { dg-warning "Hollerith constant" "const" { target *-*-* } 8 }
-! { dg-warning "Conversion" "conversion" { target *-*-* } 8 }
+write (ch, *) 5Hhello
+if (ch .ne. " hello") call abort()
+write (ch, "(A5)") 5Hhello
+if (ch .ne. "hello") call abort()
+
+end
! { dg-warning "Hollerith constant" "const" { target *-*-* } 9 }
! { dg-warning "Conversion" "conversion" { target *-*-* } 9 }
-! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 13 }
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 10 }
+! { dg-warning "Conversion" "conversion" { target *-*-* } 10 }
+
+! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 14 }
-! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 15 }
+! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 16 }
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 19 }
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 21 }