public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34759]  New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
@ 2008-01-12 20:54 dick dot hendrickson at gmail dot com
  2008-01-12 21:53 ` [Bug fortran/34759] " burnus at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-01-12 20:54 UTC (permalink / raw)
  To: gcc-bugs

With gfortran 4.3.0 20080109 I get an incorrect error message
"Error: 'source' argument of 'shape' intrinsic at (1) must not
be an assumed size array" with the following little test case

       subroutine j_assumed_size(A,N)
       dimension A(10,11,12,*)
       k = shape(A(:,:,:,N))
       l = shape(A(:,:,:,3))
       end

I believe assumed size arrays are allowed provided the last subscript
is specified.

Dick Hendrickson


-- 
           Summary: Assumed size array reference not allowed in SHAPE
                    intrinsic, even though last subscript specified
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
@ 2008-01-12 21:53 ` burnus at gcc dot gnu dot org
  2008-01-12 22:12 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-12 21:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-01-12 21:13 -------
Confirm, though your reduced test case is invalid (the variables k and l need
to be arrays. Corrected test case:

       subroutine j_assumed_size(A,N)
       dimension A(10,11,12,*), k(3), l(3)
       k = shape(A(:,:,:,N))
       l = shape(A(:,:,:,3))
       end

"SOURCE may be of any type. It may be a scalar or an array. It shall not be an
unallocated allocatable or a pointer that is not associated. It shall not be an
assumed-size array."

The shall-nots do not apply for the rank-3 arrays A(:,:,:,N) and A(:,:,:,3).
Actually, this could be a wider problem, which is not only limited to check.c's
gfc_check_shape. (For actual/dummy argument checking, I added a note to PR
34665.)

Thanks for the report.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32834
              nThis|                            |
           Keywords|                            |rejects-valid


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
  2008-01-12 21:53 ` [Bug fortran/34759] " burnus at gcc dot gnu dot org
@ 2008-01-12 22:12 ` burnus at gcc dot gnu dot org
  2008-01-12 22:41 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-12 22:12 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-12 21:24:39
               date|                            |


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
  2008-01-12 21:53 ` [Bug fortran/34759] " burnus at gcc dot gnu dot org
  2008-01-12 22:12 ` burnus at gcc dot gnu dot org
@ 2008-01-12 22:41 ` burnus at gcc dot gnu dot org
  2008-01-13 18:01 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-12 22:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-01-12 22:28 -------
Patch. I think this is the only place to change, interface's
compare_actual_formal is actually ok.

Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (revision 131492)
+++ gcc/fortran/check.c (working copy)
@@ -2394,7 +2394,7 @@ gfc_check_shape (gfc_expr *source)

   ar = gfc_find_array_ref (source);

-  if (ar->as && ar->as->type == AS_ASSUMED_SIZE)
+  if (ar->as && ar->as->type == AS_ASSUMED_SIZE && ar->type == AR_FULL)
     {
       gfc_error ("'source' argument of 'shape' intrinsic at %L must not be "
                 "an assumed size array", &source->where);


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-01-12 21:24:39         |2008-01-12 22:28:20
               date|                            |


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
                   ` (2 preceding siblings ...)
  2008-01-12 22:41 ` burnus at gcc dot gnu dot org
@ 2008-01-13 18:01 ` burnus at gcc dot gnu dot org
  2008-01-13 21:50 ` burnus at gcc dot gnu dot org
  2008-01-13 22:11 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-13 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-01-13 17:41 -------
Patch: http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00566.html


-- 


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
                   ` (3 preceding siblings ...)
  2008-01-13 18:01 ` burnus at gcc dot gnu dot org
@ 2008-01-13 21:50 ` burnus at gcc dot gnu dot org
  2008-01-13 22:11 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-13 21:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-01-13 21:29 -------
Subject: Bug 34759

Author: burnus
Date: Sun Jan 13 21:28:30 2008
New Revision: 131511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131511
Log:
2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34759
        * check.c (gfc_check_shape): Accept array ranges of
        assumed-size arrays.

2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34759
        * gfortran.dg/assumed_size_refs_4.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/34759] Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified
  2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
                   ` (4 preceding siblings ...)
  2008-01-13 21:50 ` burnus at gcc dot gnu dot org
@ 2008-01-13 22:11 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-13 22:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2008-01-13 21:49 -------
Fixed on the trunk (4.3.0).

Thanks for the report!


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-01-13 21:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-12 20:54 [Bug fortran/34759] New: Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified dick dot hendrickson at gmail dot com
2008-01-12 21:53 ` [Bug fortran/34759] " burnus at gcc dot gnu dot org
2008-01-12 22:12 ` burnus at gcc dot gnu dot org
2008-01-12 22:41 ` burnus at gcc dot gnu dot org
2008-01-13 18:01 ` burnus at gcc dot gnu dot org
2008-01-13 21:50 ` burnus at gcc dot gnu dot org
2008-01-13 22:11 ` burnus 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).