[Bug fortran/29892] substring out of bounds: Missing variable name for variables with parameter attribute

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 26 12:34:00 GMT 2006



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2006-11-26 12:34 -------
Fixed for array bounds checking on mainline. I'll backport the patch to 4.2 in
some time.

We still need to figure something out for the substrings case (see comment #0):

> Secondly, gfc_conv_substring_expr (tested by adding the following to
> gfc_conv_substring_expr:
>  printf("ERROR: gfc_conv_substring_expr: NO NAME"
>         "(in file '%s', at line %d)\n", expr->where.lb->file->filename, 
>         expr->where.lb->linenum); ):
> 
> Several matches of this kind:
> - gfortran.dg/char_cshift_1.f90
>   a(i1, i2, i3) = 'ab'(i1:i1) // 'cde'(i2:i2) // 'fghi'(i3:i3)
> => Unsolvable as no name exists
> 
> Solvable case: gfortran.dg/pr29067.f:
>       character(len=16),parameter :: s = "", s2 = "1234567890123456"
>       print *, s(9:16)
>       print *, s2(9:16)
> The problem is that s and s2 have the parameter type


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29892



More information about the Gcc-bugs mailing list