public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29941]  New: gfortran reports error with len of assumed size character array
@ 2006-11-22 15:13 william dot mitchell at nist dot gov
  2006-11-22 21:04 ` [Bug fortran/29941] " burnus at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: william dot mitchell at nist dot gov @ 2006-11-22 15:13 UTC (permalink / raw)
  To: gcc-bugs

With this subroutine:

subroutine whatever(str)
character(len=*), dimension(*) :: str
integer :: i
i = len(str)
end subroutine whatever

gfortran reports:

i = len(str)
       1
Error: The upper bound in the last dimension must appear in the reference to
the assumed size array 'str' at (1)

The subroutine is valid -- you can pass an assumed size whole array to any
subroutine that does not need to know the shape of the array, and len can
accept either a scalar or an array.

The subroutine compiles if either an explicit length is given, i.e.
character(len=10), or the array is assumed shape, i.e. dimension(:).


-- 
           Summary: gfortran reports error with len of assumed size
                    character array
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: william dot mitchell at nist dot gov


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


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

* [Bug fortran/29941] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
@ 2006-11-22 21:04 ` burnus at gcc dot gnu dot org
  2006-11-23 17:56 ` pault at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-22 21:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2006-11-22 21:04 -------
Confirmed.
Accepted without warning by NAG f95, g95,sunf95 and ifort.

In order to determine the length of a character array, the size or shape of the
array does not matter.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-22 21:04:14
               date|                            |


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


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

* [Bug fortran/29941] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
  2006-11-22 21:04 ` [Bug fortran/29941] " burnus at gcc dot gnu dot org
@ 2006-11-23 17:56 ` pault at gcc dot gnu dot org
  2006-11-28 23:43 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-23 17:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2006-11-23 17:55 -------
Tobias,

This one liner does the right thing but I have no time right now to do anything
with it:

Index: gcc/fortran/resolve.c
===================================================================
*** gcc/fortran/resolve.c       (revision 119077)
--- gcc/fortran/resolve.c       (working copy)
*************** resolve_function (gfc_expr * expr)
*** 1523,1528 ****
--- 1523,1529 ----
    else if (expr->value.function.actual != NULL
             && expr->value.function.isym != NULL
             && expr->value.function.isym->generic_id != GFC_ISYM_LBOUND
+            && expr->value.function.isym->generic_id != GFC_ISYM_LEN
             && expr->value.function.isym->generic_id != GFC_ISYM_LOC
             && expr->value.function.isym->generic_id != GFC_ISYM_PRESENT)
      {

If you want to regtest it, I would be OK with it being applied as obvious to
trunk, 4.2 and 4.1.

Paul


-- 


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


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

* [Bug fortran/29941] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
  2006-11-22 21:04 ` [Bug fortran/29941] " burnus at gcc dot gnu dot org
  2006-11-23 17:56 ` pault at gcc dot gnu dot org
@ 2006-11-28 23:43 ` pault at gcc dot gnu dot org
  2006-12-09 12:15 ` patchapp at dberlin dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-28 23:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-11-22 21:04:14         |2006-11-28 23:43:42
               date|                            |


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


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

* [Bug fortran/29941] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (2 preceding siblings ...)
  2006-11-28 23:43 ` pault at gcc dot gnu dot org
@ 2006-12-09 12:15 ` patchapp at dberlin dot org
  2006-12-09 20:42 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2006-12-09 12:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2006-12-09 12:15 -------
Subject: Bug number PR29941

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00609.html


-- 


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


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

* [Bug fortran/29941] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (3 preceding siblings ...)
  2006-12-09 12:15 ` patchapp at dberlin dot org
@ 2006-12-09 20:42 ` pault at gcc dot gnu dot org
  2006-12-21 14:33 ` [Bug fortran/29941] [4.1 and 4.2 only] " pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-09 20:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-12-09 20:42 -------
Subject: Bug 29941

Author: pault
Date: Sat Dec  9 20:41:51 2006
New Revision: 119695

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119695
Log:
2006-12-09  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29941
        * resolve.c (resolve_function): Add LEN to the functions not
        checked for assumed size actual args.


2006-12-09  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29941
        * gfortran.dg/assumed_len.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/assumed_len.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/29941] [4.1 and 4.2 only] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (4 preceding siblings ...)
  2006-12-09 20:42 ` pault at gcc dot gnu dot org
@ 2006-12-21 14:33 ` pault at gcc dot gnu dot org
  2006-12-21 14:57 ` [Bug fortran/29941] [4.1 " pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-21 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2006-12-21 14:33 -------
Subject: Bug 29941

Author: pault
Date: Thu Dec 21 14:32:51 2006
New Revision: 120111

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120111
Log:
2006-12-21  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29941
        * resolve.c (resolve_function): Add LEN to the functions not
        checked for assumed size actual args.


2006-12-21  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29941
        * gfortran.dg/assumed_len.f90: New test.


Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/assumed_len.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/resolve.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/29941] [4.1 only] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (5 preceding siblings ...)
  2006-12-21 14:33 ` [Bug fortran/29941] [4.1 and 4.2 only] " pault at gcc dot gnu dot org
@ 2006-12-21 14:57 ` pault at gcc dot gnu dot org
  2007-03-22  6:39 ` pinskia at gcc dot gnu dot org
  2007-03-22  6:40 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-21 14:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2006-12-21 14:56 -------
Fixed on trunk and 4.2

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.1 and 4.2 only] gfortran |[4.1 only] gfortran reports
                   |reports error with len of   |error with len of assumed
                   |assumed size character array|size character array


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


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

* [Bug fortran/29941] [4.1 only] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (6 preceding siblings ...)
  2006-12-21 14:57 ` [Bug fortran/29941] [4.1 " pault at gcc dot gnu dot org
@ 2007-03-22  6:39 ` pinskia at gcc dot gnu dot org
  2007-03-22  6:40 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-22  6:39 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/29941] [4.1 only] gfortran reports error with len of assumed size character array
  2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
                   ` (7 preceding siblings ...)
  2007-03-22  6:39 ` pinskia at gcc dot gnu dot org
@ 2007-03-22  6:40 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-22  6:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2007-03-22 06:39 -------
*** Bug 31308 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |van dot snyder at jpl dot
                   |                            |nasa dot gov


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


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

end of thread, other threads:[~2007-03-22  6:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 15:13 [Bug fortran/29941] New: gfortran reports error with len of assumed size character array william dot mitchell at nist dot gov
2006-11-22 21:04 ` [Bug fortran/29941] " burnus at gcc dot gnu dot org
2006-11-23 17:56 ` pault at gcc dot gnu dot org
2006-11-28 23:43 ` pault at gcc dot gnu dot org
2006-12-09 12:15 ` patchapp at dberlin dot org
2006-12-09 20:42 ` pault at gcc dot gnu dot org
2006-12-21 14:33 ` [Bug fortran/29941] [4.1 and 4.2 only] " pault at gcc dot gnu dot org
2006-12-21 14:57 ` [Bug fortran/29941] [4.1 " pault at gcc dot gnu dot org
2007-03-22  6:39 ` pinskia at gcc dot gnu dot org
2007-03-22  6:40 ` pinskia 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).