public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56849] New: Missing compile-time shape check for RESHAPE assignments
@ 2013-04-05 19:03 burnus at gcc dot gnu.org
  2013-04-05 20:02 ` [Bug fortran/56849] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-04-05 19:03 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56849
           Summary: Missing compile-time shape check for RESHAPE
                    assignments
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following code is invalid as one assigns a [1,2] array to a [2,1] variable.

NAG properly diagnoses this at compile time:
Error: test.f90, line 3: Array shapes differ in dimension 1 (extent 2 and 1)

gfortran doesn't but fails at runtime:
Fortran runtime error: shape and target do not conform


integer :: x(2,2),y(4)
y = reshape([1,2,3,4],[4])
x(:,1:1) = reshape(y(::2), [1,2])
print *, y
print *, x(:,1)
end


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

end of thread, other threads:[~2013-04-08 20:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-05 19:03 [Bug fortran/56849] New: Missing compile-time shape check for RESHAPE assignments burnus at gcc dot gnu.org
2013-04-05 20:02 ` [Bug fortran/56849] " dominiq at lps dot ens.fr
2013-04-05 20:18 ` burnus at gcc dot gnu.org
2013-04-05 20:25 ` [Bug fortran/56849] Missing compile-time shape check for RESHAPE assignments with an ORDER= attribute dominiq at lps dot ens.fr
2013-04-05 20:38 ` burnus at gcc dot gnu.org
2013-04-08 20:13 ` burnus at gcc dot gnu.org
2013-04-08 20:14 ` burnus 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).