public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25051]  New: better diagnostic needed
@ 2005-11-26 17:45 jv244 at cam dot ac dot uk
  2005-11-26 19:07 ` [Bug fortran/25051] ranks do not match in pointer assignment fxcoudert at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:45 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:

INTEGER, POINTER, DIMENSION(:,:) :: i
INTEGER, POINTER, DIMENSION(:) :: a
a=>NULL(i)
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=25051


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

* [Bug fortran/25051] ranks do not match in pointer assignment
  2005-11-26 17:45 [Bug fortran/25051] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-26 19:07 ` fxcoudert at gcc dot gnu dot org
  2006-01-08  6:17 ` [Bug fortran/25051] ranks do not match in pointer assignment with NULL pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-26 19:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:07 -------
gfortran doesn't see this code is invalid.

## g95 ##
In file foo.f90:3

a=>NULL(i)
       1
Error: Unequal ranks in pointer assignment at (1) (1/2)
## Intel ##
fortcom: Error: foo.f90, line 3: The rank of the target is different from the
pointer   [A]
a=>NULL(i)
^
compilation aborted for foo.f90 (code 1)
## Portland ##
PGF90-S-0155-Illegal POINTER assignment - rank mismatch (foo.f90: 3)
  0 inform,   0 warnings,   1 severes, 0 fatal for MAIN
## Sun ##

a=>NULL(i)
 ^
"foo.f90", Line = 3, Column = 2: ERROR: The target in a pointer assignment
statement must have the same rank as the pointer.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-26 19:07:11
               date|                            |
            Summary|better diagnostic needed    |ranks do not match in
                   |                            |pointer assignment


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


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

* [Bug fortran/25051] ranks do not match in pointer assignment with NULL
  2005-11-26 17:45 [Bug fortran/25051] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:07 ` [Bug fortran/25051] ranks do not match in pointer assignment fxcoudert at gcc dot gnu dot org
@ 2006-01-08  6:17 ` pinskia at gcc dot gnu dot org
  2006-01-08  6:19 ` [Bug fortran/25051] NULL doesn't get its argument type (rank) pinskia at gcc dot gnu dot org
  2006-02-10 20:13 ` kargl at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-08  6:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-08 06:17 -------
Hmm, (I have not looked at the source yet but) I suspect we are not recording
the type of NULL so that we get a NULL without a kind.
This shows that I am more likely correct:
REAL, POINTER, DIMENSION(:,:) :: i
INTEGER, POINTER, DIMENSION(:,:) :: a
a=>NULL(i)
END


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
            Summary|ranks do not match in       |ranks do not match in
                   |pointer assignment          |pointer assignment with NULL


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



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

* [Bug fortran/25051] NULL doesn't get its argument type (rank)
  2005-11-26 17:45 [Bug fortran/25051] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:07 ` [Bug fortran/25051] ranks do not match in pointer assignment fxcoudert at gcc dot gnu dot org
  2006-01-08  6:17 ` [Bug fortran/25051] ranks do not match in pointer assignment with NULL pinskia at gcc dot gnu dot org
@ 2006-01-08  6:19 ` pinskia at gcc dot gnu dot org
  2006-02-10 20:13 ` kargl at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-08  6:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-08 06:19 -------
Oh, my example is just PR 20858.  I think they are the same problem but I don't
know for sure.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |20858
            Summary|NULL doesn't get its        |NULL doesn't get its
                   |argument type               |argument type (rank)


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



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

* [Bug fortran/25051] NULL doesn't get its argument type (rank)
  2005-11-26 17:45 [Bug fortran/25051] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2006-01-08  6:19 ` [Bug fortran/25051] NULL doesn't get its argument type (rank) pinskia at gcc dot gnu dot org
@ 2006-02-10 20:13 ` kargl at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-02-10 20:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kargl at gcc dot gnu dot org  2006-02-10 20:13 -------
Fixed on 4.1 and trunk by the patch committed for pr 20858.

troutmask:sgk[226] cat > ptr.f90
INTEGER, POINTER, DIMENSION(:,:) :: i
INTEGER, POINTER, DIMENSION(:) :: a
a=>NULL(i)
END

troutmask:sgk[227] gfc41 -c ptr.f90
 In file ptr.f90:3

a=>NULL(i)
1
Error: Different ranks in pointer assignment at (1)


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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


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

end of thread, other threads:[~2006-02-10 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:45 [Bug fortran/25051] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-26 19:07 ` [Bug fortran/25051] ranks do not match in pointer assignment fxcoudert at gcc dot gnu dot org
2006-01-08  6:17 ` [Bug fortran/25051] ranks do not match in pointer assignment with NULL pinskia at gcc dot gnu dot org
2006-01-08  6:19 ` [Bug fortran/25051] NULL doesn't get its argument type (rank) pinskia at gcc dot gnu dot org
2006-02-10 20:13 ` kargl 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).