public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32002]  New: insufficient conformance check when assigning the result of an elemental function to an array
@ 2007-05-19 16:07 dfranke at gcc dot gnu dot org
  2007-05-19 20:32 ` [Bug fortran/32002] [4.2/4.3 regression] " dfranke at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-19 16:07 UTC (permalink / raw)
  To: gcc-bugs

The problem shown here applies to elemental functions in general, not only
(elemental) intrinsics, see below for an example:

$> cat assign.f90
real :: a(3) = 0.0, b(2) = (/ 0.0, 0.1 /)
a = COS(b)
print *, a
end

$> gfortran-svn assign.f90 && ./a.out
   1.000000      0.9950042       1.000000


$> ifort -warn all assign.f90 && ./a.out
fortcom: Error: assign.f90, line 2: The shapes of the array expressions do not
conform.   [A]
a = COS(b)
^
compilation aborted for assign.f90 (code 1)

$> sunf95 -w4 assign.f90 && ./a.out

a = COS(b)
  ^
"assign.f90", Line = 2, Column = 3: ERROR: The left and right hand sides of
this array syntax assignment must be conformable arrays.

f90comp: 4 SOURCE LINES
f90comp: 1 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI

Same example as above with elemental function:

$> cat assign.f90
real :: a(3) = 0.0, b(2) = (/ 0.0, 0.1 /)
a = f(b)
print *, a

contains
  real elemental function f(x)
    real, INTENT(iN) :: x
    f = cos(x)
  end function
end

$> gfortran-svn assign.f90 && ./a.out
   1.000000      0.9950042       1.000000


-- 
           Summary: insufficient conformance check when assigning the result
                    of an elemental function to an array
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-06-20 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-19 16:07 [Bug fortran/32002] New: insufficient conformance check when assigning the result of an elemental function to an array dfranke at gcc dot gnu dot org
2007-05-19 20:32 ` [Bug fortran/32002] [4.2/4.3 regression] " dfranke at gcc dot gnu dot org
2007-05-20  0:21 ` jvdelisle at gcc dot gnu dot org
2007-05-20 12:12 ` dfranke at gcc dot gnu dot org
2007-05-20 23:16 ` patchapp at dberlin dot org
2007-05-21 21:37 ` dfranke at gcc dot gnu dot org
2007-05-21 22:25 ` dfranke at gcc dot gnu dot org
2007-05-31 12:01 ` [Bug fortran/32002] [4.2 " fxcoudert at gcc dot gnu dot org
2007-06-20 21:35 ` dfranke at gcc dot gnu dot org
2007-06-20 21:37 ` dfranke 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).