This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran, patch] Fix pr20954
- From: Feng Wang <wf_cs at yahoo dot com>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: pinskia at physics dot uc dot edu, tobias dot schlueter at physik dot uni-muenchen dot de
- Date: Tue, 17 May 2005 22:51:18 +0800 (CST)
- Subject: [gfortran, patch] Fix pr20954
This patch fix PR20954. Use correct type to build character length. Tested with
no regression on i686-linux.
ChangeLog entry:
2005-05-17 Feng Wang <fengwang@nudt.edu.cn>
PR fortran/20954
* trans-const.c (gfc_conv_const_charlen): Use gfc_charlen_type_node to
build character length.
Best Regards,
Feng Wang
--
Creative Compiler Research Group,
National University of Defense Technology, China.
_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
! { dg-do run }
! { dg-options "-fdefault-integer-8" }
! Program to test character length type
Program pr20954
character*16 string (5)
character*5 filename
character*80 line
filename = 'input'
open (2,file=filename)
write (line, '(5a16)') (string(i),i=1,5)
end
? 20594.diff
? trans-const.c.wf
Index: trans-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-const.c,v
retrieving revision 1.26
diff -c -3 -p -r1.26 trans-const.c
*** trans-const.c 23 Apr 2005 15:33:33 -0000 1.26
--- trans-const.c 17 May 2005 13:49:06 -0000
*************** gfc_conv_const_charlen (gfc_charlen * cl
*** 141,146 ****
--- 141,148 ----
{
cl->backend_decl = gfc_conv_mpz_to_tree (cl->length->value.integer,
cl->length->ts.kind);
+ cl->backend_decl = fold_convert (gfc_charlen_type_node,
+ cl->backend_decl);
}
}