public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25080]  New: better diagnostic needed
@ 2005-11-26 17:58 jv244 at cam dot ac dot uk
  2005-11-28 22:13 ` [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments eedelman at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:58 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

   TYPE T1
      INTEGER :: i(2,2)
   END TYPE
   TYPE(T1) :: a
   a=T1((/1,2,3,4/))
   END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments
  2005-11-26 17:58 [Bug fortran/25080] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-28 22:13 ` eedelman at gcc dot gnu dot org
  2006-10-23 19:28 ` fxcoudert at gcc dot gnu dot org
  2007-01-01 21:58 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-11-28 22:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from eedelman at gcc dot gnu dot org  2005-11-28 22:13 -------
With gfortran 4.2.0 20051128 I get an ICE for this code. 

This slightly different code (but with basically the same error), however,
compiles and outputs 10, when we should get an error:

integer :: a
a=T1((/1,2,3,4/))
print *, a
contains
    integer function T1(x)
        integer, intent(in) :: x(2,2)
        T1 = sum(x)
    end function T1
END


-- 

eedelman at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic, ice-on-invalid-
                   |                            |code
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-28 22:13:37
               date|                            |
            Summary|better diagnostic needed    |ICE/missing error on
                   |                            |different ranks for dummy
                   |                            |and actual arguments


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


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

* [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments
  2005-11-26 17:58 [Bug fortran/25080] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-28 22:13 ` [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments eedelman at gcc dot gnu dot org
@ 2006-10-23 19:28 ` fxcoudert at gcc dot gnu dot org
  2007-01-01 21:58 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-10-23 19:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2006-10-23 19:28 -------
We now reject the reporter's code as we should. We could still reject the code
in comment #1, but none of the other compilers I tried reject it. Marking this
as low priority (I think it will be fixed by Paul Thomas' patch for in-file
checking).


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
           Keywords|ice-on-invalid-code         |
   Last reconfirmed|2006-06-04 10:26:41         |2006-10-23 19:28:02
               date|                            |


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


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

* [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments
  2005-11-26 17:58 [Bug fortran/25080] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-28 22:13 ` [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments eedelman at gcc dot gnu dot org
  2006-10-23 19:28 ` fxcoudert at gcc dot gnu dot org
@ 2007-01-01 21:58 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-01-01 21:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2007-01-01 21:58 -------
(In reply to comment #2)
> We now reject the reporter's code as we should. We could still reject the code
> in comment #1, but none of the other compilers I tried reject it. Marking this
> as low priority (I think it will be fixed by Paul Thomas' patch for in-file
> checking).
>
12.4.1.1 Actual arguments associated with dummy data objects
....
If the dummy argument is an assumed-shape array, the rank of the dummy
argument shall agree with the rank of the actual argument.

12.4.1.4 Sequence association
....
The rank and shape of the actual argument need not agree with the rank and
shape of the dummy argument, but the number of elements in the dummy argument
shall not exceed the number of elements in the element sequence of the actual
argument. If the dummy argument is assumed-size, the number of elements in the
dummy argument is exactly the number of elements in the element sequence.

Apart from the requirement on the number of elements in the dummy (PR25071),
gfortran complies with the standard and, as noted already, fixes the original
bug.

I am therefore marking this bug as fixed.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-01-01 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:58 [Bug fortran/25080] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-28 22:13 ` [Bug fortran/25080] ICE/missing error on different ranks for dummy and actual arguments eedelman at gcc dot gnu dot org
2006-10-23 19:28 ` fxcoudert at gcc dot gnu dot org
2007-01-01 21:58 ` pault 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).