public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29892]  New: substring out of bounds: Missing variable name for variables with parameter attribute
@ 2006-11-19 11:53 burnus at gcc dot gnu dot org
  2006-11-19 12:51 ` [Bug fortran/29892] " fxcoudert at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-19 11:53 UTC (permalink / raw)
  To: gcc-bugs

see also: http://gcc.gnu.org/ml/fortran/2006-11/msg00511.html

With -fbounds-check, an error message is shown if the character substrings
exceed the size of the variable. This error message contains also the name of
the variable, but this piece of information is not always passed to
gfc_conv_substring.

There are two places where gfc_conv_substring is called:
a) In gfc_conv_variable
b) In gfc_conv_substring_expr, here the name is always unknown.

I checked it against the regression test suite. The result:

First case, gfc_conv_variable: None found.

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


-- 
           Summary: substring out of bounds: Missing variable name for
                    variables with parameter attribute
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-25 12:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29892-4@http.gcc.gnu.org/bugzilla/>
2013-06-25 12:29 ` [Bug fortran/29892] substring out of bounds: Missing variable name for variables with parameter attribute dominiq at lps dot ens.fr
2006-11-19 11:53 [Bug fortran/29892] New: " burnus at gcc dot gnu dot org
2006-11-19 12:51 ` [Bug fortran/29892] " fxcoudert at gcc dot gnu dot org
2006-11-19 12:52 ` fxcoudert at gcc dot gnu dot org
2006-11-26 12:26 ` fxcoudert at gcc dot gnu dot org
2006-11-26 12:34 ` fxcoudert at gcc dot gnu dot org
2006-12-11 20:58 ` fxcoudert at gcc dot gnu dot org
2007-01-02 14:30 ` fxcoudert at gcc dot gnu dot org
2007-05-14 21:29 ` mmitchel at gcc dot gnu dot org
2007-07-20  3:49 ` mmitchel at gcc dot gnu dot org
2007-10-09 19:28 ` mmitchel at gcc dot gnu dot org
2008-02-01 17:00 ` jsm28 at gcc dot gnu dot org
2008-02-01 17:23 ` fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).