This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, fortran] Simplify constant substrings
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 21 Jul 2005 23:41:51 -0700
- Subject: Re: [PATCH, fortran] Simplify constant substrings
- References: <200507220453.j6M4rCd26890@makai.watson.ibm.com>
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