public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34805]  New: defined assignment not allowed to vector subscripted array
@ 2008-01-15 23:04 dick dot hendrickson at gmail dot com
  2008-01-16  8:47 ` [Bug fortran/34805] " burnus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-01-15 23:04 UTC (permalink / raw)
  To: gcc-bugs

The test program gives the message:
c_tests_cg0018.f:28.20:

      TLA1L(NFV1) = UDA1R
                   1
Error: Can't convert TYPE(seq) to TYPE(unseq) at (1)

Where NFV1 is an integer scalar array.

I believe the error is incorrect.  This is from the SHAPE95 test suite.
This test was contentious during the suite development and at least
one vendor almost submitted an interpretation request.  I believe
that lines 27 to 30 of page 110 say that elemental defined assignments
are processed element-by-element, in any order, so that it's as if 
things were written
      TLA1L(3) = UDA1R(3)
      TLA1L(7) = UDA1R(7)
      ....
and those assignments are perfectly well defined (and gfortran accepts
similar ones).  Additionally, assignments like
      real_array(NFV1) = some_other_array
are well defined (with a restriction on NFV1's values).  That's the gist
of the argument as I remember it from 10 years ago.  

The sample program is

      MODULE c_TESTS

      integer, save :: nfv1(10)

      TYPE UNSEQ
        REAL                              R
      END TYPE UNSEQ       

      TYPE SEQ
        sequence
        REAL                              R
      END TYPE SEQ       

      INTERFACE ASSIGNMENT(=)
        MODULE PROCEDURE C_U_TO_T
      END INTERFACE ASSIGNMENT(=)

      CONTAINS

      ELEMENTAL PURE SUBROUTINE C_U_TO_T(T,U)
      TYPE(SEQ),INTENT(IN)      ::  U
      TYPE(UNSEQ), INTENT(OUT)  ::  T
      T%R = U%R
      END SUBROUTINE C_U_TO_T

      SUBROUTINE CG1018(UDA1R)
      TYPE(UNSEQ) TLA1L(10)
      TYPE(SEQ) UDA1R(10)
      TLA1L(NFV1) = UDA1R
      END SUBROUTINE
      END MODULE c_TESTS


-- 
           Summary: defined assignment not allowed to vector subscripted
                    array
           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=34805


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-34805-4@http.gcc.gnu.org/bugzilla/>]

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-15 23:04 [Bug fortran/34805] New: defined assignment not allowed to vector subscripted array dick dot hendrickson at gmail dot com
2008-01-16  8:47 ` [Bug fortran/34805] " burnus at gcc dot gnu dot org
2008-01-16 17:34 ` burnus at gcc dot gnu dot org
2008-01-16 20:37 ` dick dot hendrickson at gmail dot com
2008-01-25  9:52 ` dfranke at gcc dot gnu dot org
2008-03-31 19:23 ` pault at gcc dot gnu dot org
2008-08-08 20:41 ` jv244 at cam dot ac dot uk
2008-08-12 18:29 ` dick dot hendrickson at gmail dot com
2008-09-10 12:10 ` [Bug fortran/34805] Better error message for: " burnus at gcc dot gnu dot org
     [not found] <bug-34805-4@http.gcc.gnu.org/bugzilla/>
2010-12-29  3:06 ` dfranke at gcc dot gnu.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).