[PATCH, fortran] Simplify constant substrings

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Jul 22 06:42:00 GMT 2005


On Fri, Jul 22, 2005 at 12:53:12AM -0400, David Edelsohn wrote:
> 	While investigating other string issues, I noticed that substring
> parameters are not set correctly.  This is because substrings are not
> simplified.
> 
>         program foo
>         character*2 a
>         character*4 b
>         character*6 c
>         parameter (a="12")
>         parameter (b = a(1:2))
>         write (c,'("#",A,"#")') b
> 	if (c .ne. '#12  #') call abort
>         end
> 
> The following patch evaluates a constant substring, substitutes it into
> the expr string, and converts the expr to a constant.  Did I update all of
> the required fields?
> 
> Thanks, David
> 

David, I'll review this patch and other patch you submitted a few
days ago on Saturday.  I think, that if you look, you'll find that
gfortran's handling of strings and substrings has many hidden bugs.

-- 
Steve



More information about the Gcc-patches mailing list