User account creation filtered due to spam.

Bug 16531 - [4.0 only, gfortran] Hollerith Data not supported
Summary: [4.0 only, gfortran] Hollerith Data not supported
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 enhancement
Target Milestone: 4.0.2
Assignee: fengwang
URL:
Keywords:
: 20825 (view as bug list)
Depends on:
Blocks: 19292
  Show dependency treegraph
 
Reported: 2004-07-13 20:55 UTC by Won-Kyu Park
Modified: 2005-07-12 04:25 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-10-12 01:26:28


Attachments
fortran patch. (3.92 KB, patch)
2005-02-28 10:27 UTC, Feng Wang
Details | Diff
patch for libgfortran (228 bytes, patch)
2005-02-28 10:28 UTC, Feng Wang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Won-Kyu Park 2004-07-13 20:55:27 UTC
---- test.f from
http://www.ictp.trieste.it/~manuals/programming/sun/fortran/prog_guide/7_porting.doc.html#658

	double complex x(2) 
	data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ 
	write( 6, '(4A8, "!")' ) x 
	end 
----
Hollerith Data type does not supported now.

g77 compile it successfully but gfortran does not.
Comment 1 Andrew Pinski 2004-07-13 22:38:34 UTC
Confirmed
Comment 2 Feng Wang 2004-12-27 08:11:59 UTC
I am working for this PR. Hope to give a patch soon.
Comment 3 Jerry DeLisle 2005-02-27 19:13:05 UTC
Is anyone working on this?  It is blocking some significant codes I am testing.
Comment 4 Feng Wang 2005-02-28 10:27:14 UTC
Created attachment 8297 [details]
fortran patch.

patch for fortran.
Comment 5 Feng Wang 2005-02-28 10:28:36 UTC
Created attachment 8298 [details]
patch for libgfortran

libgfortran patch
Comment 6 Feng Wang 2005-02-28 10:30:09 UTC
(In reply to comment #3)
> Is anyone working on this?  It is blocking some significant codes I am 
testing.

Yes. I have worked it out. I am waiting for the committing of my patch for 
PR18827 which blocks this fixing.

If you like, you can try this patch. But you need apply the patch I posted in 
the message: http://gcc.gnu.org/ml/fortran/2005-02/msg00255.html first. Or you 
will fail to patch. Welcom to use and test.

Best Regards,
Feng Wang
Comment 7 Andrew Pinski 2005-04-08 11:47:00 UTC
*** Bug 20825 has been marked as a duplicate of this bug. ***
Comment 8 CVS Commits 2005-07-07 07:55:42 UTC
Subject: Bug 16531

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fengwang@gcc.gnu.org	2005-07-07 07:55:00

Modified files:
	libgfortran    : ChangeLog 
	gcc/fortran    : ChangeLog arith.c expr.c intrinsic.c io.c 
	                 misc.c primary.c simplify.c trans-const.c 
	                 trans-io.c arith.h gfortran.h 
	gcc/testsuite  : ChangeLog 
	libgfortran/io : transfer.c 
Added files:
	gcc/testsuite/gfortran.dg: hollerith.f90 hollerith2.f90 
	                           hollerith3.f90 hollerith4.f90 
	                           hollerith_f95.f90 
	                           hollerith_legacy.f90 
	gcc/testsuite/gfortran.dg/g77: cpp4.F 

Log message:
	For the 60th anniversary of Chinese people¡¯s Anti-Japan war victory.
	
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	
	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* arith.c (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	New functions.
	(eval_intrinsic): Don't evaluate if Hollerith constant arguments exist.
	* arith.h (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	Add prototypes.
	* expr.c (free_expr0): Free memery allocated for Hollerith constant.
	(gfc_copy_expr): Allocate and copy string if Expr is from Hollerith.
	(gfc_check_assign): Enable conversion from Hollerith to other.
	* gfortran.h (bt): Add BT_HOLLERITH.
	(gfc_expr): Add from_H flag.
	* intrinsic.c (gfc_type_letter): Return 'h' for BT_HOLLERITH.
	(add_conversions): Add conversions from Hollerith constant to other.
	(do_simplify): Don't simplify if  Hollerith constant arguments exist.
	* io.c (resolve_tag): Enable array in FORMAT tag under GFC_STD_GNU.
	* misc.c (gfc_basetype_name): Return "HOLLERITH" for BT_HOLLERITH.
	(gfc_type_name): Print "HOLLERITH" for BT_HOLLERITH.
	* primary.c (match_hollerith_constant): New function.
	(gfc_match_literal_constant): Add match Hollerith before Integer.
	* simplify.c (gfc_convert_constant): Add conversion from Hollerith
	to other.
	* trans-const.c (gfc_conv_constant_to_tree): Use VIEW_CONVERT_EXPR to
	convert Hollerith constant to tree.
	* trans-io.c (gfc_convert_array_to_string): Get array's address and
	length to set string expr.
	(set_string): Deal with array assigned Hollerith constant and character
	array.
	* gfortran.texi: Document Hollerith constants as extention support.
	
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	
	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* gfortran.dg/hollerith.f90: New.
	* gfortran.dg/hollerith2.f90: New.
	* gfortran.dg/hollerith3.f90: New.
	* gfortran.dg/hollerith4.f90: New.
	* gfortran.dg/hollerith_f95.f90: New.
	* gfortran.dg/hollerith_legacy.f90: New.
	* gfortran.dg/g77/cpp4.F: New. Port from g77.
	
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	
	PR fortran/16531
	* io/transfer.c (formatted_transfer): Enable FMT_A on other types to
	support Hollerith constants.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.255&r2=1.256
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.485&r2=1.486
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/arith.c.diff?cvsroot=gcc&r1=1.29&r2=1.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&r1=1.26&r2=1.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&r1=1.51&r2=1.52
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&r1=1.27&r2=1.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/misc.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/primary.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/simplify.c.diff?cvsroot=gcc&r1=1.29&r2=1.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-const.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&r1=1.37&r2=1.38
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/arith.h.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.74&r2=1.75
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5732&r2=1.5733
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.46&r2=1.47
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith3.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith4.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith_f95.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith_legacy.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/g77/cpp4.F.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 9 CVS Commits 2005-07-12 01:51:01 UTC
Subject: Bug 16531

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	fengwang@gcc.gnu.org	2005-07-12 01:50:48

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/intrinsics: etime.c getcwd.c stat.c unlink.c 
	libgfortran/io : transfer.c unit.c 
	libgfortran/runtime: string.c 
	gcc/testsuite  : ChangeLog 
	gcc/fortran    : ChangeLog arith.c arith.h expr.c gfortran.h 
	                 gfortran.texi intrinsic.c io.c misc.c primary.c 
	                 simplify.c trans-const.c trans-io.c 
Added files:
	gcc/testsuite/gfortran.dg: hollerith.f90 hollerith2.f90 
	                           hollerith3.f90 hollerith4.f90 
	                           hollerith_f95.f90 
	                           hollerith_legacy.f90 
	gcc/testsuite/gfortran.dg/g77: cpp4.F 

Log message:
	2005-07-12  Feng Wang  <fengwang@nudt.edu.cn>
	
	Backport from the mainline:
	2005-03-05  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
	* trans-const.c (gfc_conv_constant_to_tree): Use correct tree
	type for COMPLEX constants.
	
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* arith.c (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	New functions.
	(eval_intrinsic): Don't evaluate if Hollerith constant arguments exist.
	* arith.h (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	Add prototypes.
	* expr.c (free_expr0): Free memery allocated for Hollerith constant.
	(gfc_copy_expr): Allocate and copy string if Expr is from Hollerith.
	(gfc_check_assign): Enable conversion from Hollerith to other.
	* gfortran.h (bt): Add BT_HOLLERITH.
	(gfc_expr): Add from_H flag.
	* intrinsic.c (gfc_type_letter): Return 'h' for BT_HOLLERITH.
	(add_conversions): Add conversions from Hollerith constant to other.
	(do_simplify): Don't simplify if  Hollerith constant arguments exist.
	* io.c (resolve_tag): Enable array in FORMAT tag under GFC_STD_GNU.
	* misc.c (gfc_basetype_name): Return "HOLLERITH" for BT_HOLLERITH.
	(gfc_type_name): Print "HOLLERITH" for BT_HOLLERITH.
	* primary.c (match_hollerith_constant): New function.
	(gfc_match_literal_constant): Add match Hollerith before Integer.
	* simplify.c (gfc_convert_constant): Add conversion from Hollerith
	to other.
	* trans-const.c (gfc_conv_constant_to_tree): Use VIEW_CONVERT_EXPR to
	convert Hollerith constant to tree.
	* trans-io.c (gfc_convert_array_to_string): Get array's address and
	length to set string expr.
	(set_string): Deal with array assigned Hollerith constant and character
	array.
	* gfortran.texi: Document Hollerith constants as extention support.
	
	2005-07-12  Feng Wang  <fengwang@nudt.edu.cn>
	
	Backport from the mainline:
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* gfortran.dg/hollerith.f90: New.
	* gfortran.dg/hollerith2.f90: New.
	* gfortran.dg/hollerith3.f90: New.
	* gfortran.dg/hollerith4.f90: New.
	* gfortran.dg/hollerith_f95.f90: New.
	* gfortran.dg/hollerith_legacy.f90: New.
	* gfortran.dg/g77/cpp4.F: New. Port from g77.
	
	2005-07-12  Feng Wang  <fengwang@nudt.edu.cn>
	
	* runtime/string.c (compare0): Remove unused variable.
	* intrinsics/etime.c (etime_sub): Ditto.
	* intrinsics/getcwd.c (getcwd_i4_sub): Ditto.
	* intrinsics/stat.c (stat_i4_sub stat_i8_sub fstat_i4_sub
	fstat_i8_sub): Ditto.
	* intrinsics/unlink.c (unlink_i4_sub): Ditto.
	* io/unit.c (init_units): Ditto.
	
	Backport from mainline.
	2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>
	PR fortran/16531
	* io/transfer.c (formatted_transfer): Enable FMT_A on other types to
	support Hollerith constants.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith2.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith3.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith4.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith_f95.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/hollerith_legacy.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/g77/cpp4.F.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.58&r2=1.163.2.59
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/etime.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5&r2=1.5.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getcwd.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/stat.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4.14.1&r2=1.4.14.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/unlink.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4&r2=1.4.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.32.2.7&r2=1.32.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/unit.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.8.10.1&r2=1.8.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/runtime/string.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4.12.1&r2=1.4.12.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.267&r2=1.5084.2.268
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.86&r2=1.335.2.87
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/arith.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.22.2.2&r2=1.22.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/arith.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4.36.1&r2=1.4.36.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.23.2.2&r2=1.23.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.58.2.9&r2=1.58.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.texi.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.10.8.5&r2=1.10.8.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.44.2.5&r2=1.44.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19.10.5&r2=1.19.10.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/misc.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.8&r2=1.8.10.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/primary.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.22.2.6&r2=1.22.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/simplify.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19.2.4&r2=1.19.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-const.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.21.10.1&r2=1.21.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.33.2.3&r2=1.33.2.4

Comment 10 Andrew Pinski 2005-07-12 04:25:01 UTC
Fixed.