Enable Hollerith constant and character arrayin format tag (take 3).

Feng Wang wf_cs@yahoo.com
Wed Jun 29 13:17:00 GMT 2005


1. Change to enable this feature under GFC_STD_LEGACY.
2. Fix a bug when matching Hollerith constants.
3. More tests.

Tested on i686-linux with no regression.

The original patch:
http://gcc.gnu.org/ml/fortran/2005-05/msg00280.html
http://gcc.gnu.org/ml/fortran/2005-03/msg00502.html

libgfortran Changelog:
2005-06-29  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/16531
	* io/transfer.c (formatted_transfer): Delete unused variable. Enable
	FMT_A on other types for supporting Hollerith constants.

fortran Changelog:
2005-06-27  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.



Best Regards,
Feng Wang

--
Creative Compiler Research Group,
National University of Defense Technology, China.

__________________________________________________
¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libgfortran.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050629/526fc8d0/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hollerith_v14.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050629/526fc8d0/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cpp4.F
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050629/526fc8d0/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hollerith2.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050629/526fc8d0/attachment.f90>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hollerith3.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050629/526fc8d0/attachment-0001.f90>


More information about the Fortran mailing list