[Gfortran, patch] Fix simplify char and ichar intrinsic
Feng Wang
wf_cs@yahoo.com
Fri Jan 6 10:22:00 GMT 2006
:ADDPATCH fortran:
When changing my patch for PR12456, I found another bug in ichar intrinsic.
On compile-time, we use signed char to hold characters. When we get the index
of a character in gfc_simplify_ichar, first we should convert to unsigned char
type.
Before applying the patch, we get
ichar (char (255)) = -1
Fortran ChangeLog entry:
2006-01-06 Feng Wang <fengwang@nudt.edu.cn>
* simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
constant.
(gfc_simplify_ichar): Get the result from unsinged char and in the
range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
Testsuite ChangeLog entry:
2006-01-06 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.dg/intrinsic_i_char.f90: New test.
Best Regards,
Feng Wang
--
Creative Compiler Research Group,
National University of Defense Technology, China.
___________________________________________________________
ÃÃ
Ȣ1GÃâ·ÃÃÃÃä°Ã·Ã°Ã·Ãì»øÃÃ
http://cn.mail.yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr12456.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060106/dcfabda2/attachment.f90>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr12456.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060106/dcfabda2/attachment.ksh>
More information about the Fortran
mailing list