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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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 ` dfranke at gcc dot gnu dot org
  2007-05-20  0:21 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-19 20:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dfranke at gcc dot gnu dot org  2007-05-19 21:31 -------
$> cat assign.f90
real :: a(3), b(2)
a = 5.0
b = (/ 0.0, 0.1 /)
a = cos(b)
print *, a
end

$> gfortran-svn assign.f90
assign.f90:4.1:

a = cos(b)
1
Error: different shape for array assignment at (1) on dimension 1 (3/2)


Both testcases, this one and in the original report, differ in the location of
the respective initialization only. 


-- 


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


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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-05-20  0:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2007-05-20 01:21 -------
I have observed the problem with no initialization.  This may be a hint.

real :: a(3), b(2)
a = COS(b)
print *, a
end


-- 


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


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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-20 12:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2007-05-20 13:12 -------
This triggers the error ...

real :: a(3), b(2)
a = COS(b(:))
end


-- 


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


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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (2 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-20 23:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2007-05-21 00:16 -------
Subject: Bug number PR32002

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/2007-05/msg01315.html


-- 


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


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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (3 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-21 21:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2007-05-21 22:37 -------
Related report: PR26976


-- 


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


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

* [Bug fortran/32002] [4.2/4.3 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (4 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-21 22:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2007-05-21 23:25 -------
Subject: Bug 32002

Author: dfranke
Date: Mon May 21 22:24:55 2007
New Revision: 124924

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124924
Log:
gcc/fortran:
2005-05-21  Jerry DeLisle  <jvdelisle@verizon.net>
            Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/32002
        * resolve.c (resolve_actual_arglist): Resolve actual argument after
        being identified as variable.


gcc/testsuite:
2005-05-21  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/32002
        * gfortran.dg/compliant_elemental_intrinsics_2.f90: New test.



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


-- 


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


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

* [Bug fortran/32002] [4.2 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (5 preceding siblings ...)
  2007-05-21 22:25 ` dfranke at gcc dot gnu dot org
@ 2007-05-31 12:01 ` 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
  8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-31 12:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|4.2.1 4.3.0                 |4.2.1
      Known to work|4.1.1                       |4.1.1 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-31 12:01:02
               date|                            |
            Summary|[4.2/4.3 regression]        |[4.2 regression]
                   |insufficient conformance    |insufficient conformance
                   |check when assigning the    |check when assigning the
                   |result of an elemental      |result of an elemental
                   |function to an array        |function to an array
   Target Milestone|---                         |4.3.0


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


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

* [Bug fortran/32002] [4.2 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (6 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-06-20 21:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dfranke at gcc dot gnu dot org  2007-06-20 21:35 -------
Subject: Bug 32002

Author: dfranke
Date: Wed Jun 20 21:35:04 2007
New Revision: 125898

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125898
Log:
gcc/fortran:
2007-07-20  Daniel Franke  <franke.daniel@gmail.com>

        Backport from trunk:
        PR fortran/32002
        * resolve.c (resolve_actual_arglist): Resolve actual argument after
        being identified as variable.

gcc/testsuite:
2007-06-20  Daniel Franke  <franke.daniel@gmail.com>

        Backport from trunk:
        PR fortran/32002
        * gfortran.dg/compliant_elemental_intrinsics_2.f90: New test.


Added:
   
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/compliant_elemental_intrinsics_2.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=32002


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

* [Bug fortran/32002] [4.2 regression] insufficient conformance check when assigning the result of an elemental function to an array
  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
                   ` (7 preceding siblings ...)
  2007-06-20 21:35 ` dfranke at gcc dot gnu dot org
@ 2007-06-20 21:37 ` dfranke at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-06-20 21:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2007-06-20 21:37 -------
Fixed in 4.2 and trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|4.2.1                       |
      Known to work|4.1.1 4.3.0                 |4.1.1 4.2.1 4.3.0
         Resolution|                            |FIXED
   Target Milestone|4.3.0                       |4.2.1


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).