This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/gfortran] Partial fix for PR fortran/20879


The attached patch is a partial fix for fortran/20879.
I have no idea how to generate the runtime error 
checking in trans-intrinsic.c(gfc_conv_intrinsic_ichar).
We need such a check to find problems in programs of
the form

   program a
   integer :: i = 1, j = 2
   character(len=8) :: c='abcd'
   i = ichar(c(i:j))  ! Length of c should be 1.
   end program a

If anyone can implement the 10 lines of needed code,
I would be most grateful.  In short, we need to check
that i and j are equal.

I have bootstrapped, regression tested, and run my
private Fortran testsuite with this patch.

OK for mainline?

2005-04-23  Steven G. Kargl  <kargls@comcast.net>

	* check.c (gfc_check_ichar): New function
	* intrinsic.h: Declare it.
	* intrinsic.c (add_functions): Use it.

2005-04-23  Steven G. Kargl  <kargls@comcast.net>

	* gfortran.dg/PR20879.f90: New test.


-- 
Steve

Attachment: ichar.diff
Description: Text document

Attachment: PR20879.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]