public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34547]  New: NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
@ 2007-12-21 10:24 burnus at gcc dot gnu dot org
  2008-01-16 21:36 ` [Bug fortran/34547] " burnus at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-21 10:24 UTC (permalink / raw)
  To: gcc-bugs

The following gives an ICE:

  print *, NULL()

The program is invalid as the MOLD of NULL([MOLD]) is required in this context
(see F2003, 13.7.88): "If MOLD is absent, the characteristics of the result are
determined by the entity with which the reference is associated. See Table
13.1. MOLD shall not be absent in any other context."

Table 13.1 contains: rhs of pointer assignment; initialization of an object in
a declaration; default component init; struct constr; actual argument; in a
DATA statement.

Likewise for Fortran 97, see 7.1.4.1 around Table 7.2 - and 13.14.79.

---------------------

 integer, allocatable :: i(:)
 print *, NULL(i)

Prints: Error: 'mold' argument of 'null' intrinsic at (1) must be a POINTER.

While Fortran 97 has: "MOLD shall be a pointer and may be of any type."
Fortran 2003 has: "MOLD shall be a pointer or allocatable. It may be of any
type or may be a procedure pointer".

----

NULL as actual argument:

  external foo
  call foo(NULL())

is invalid without a MOLD as (F2003, similar in F97):
"If any type parameters of the contextual entity are deferred, those type
parameters of the result are deferred. If any type parameters of the contextual
entity are assumed, MOLD shall be present.
If the context of the reference to NULL is an actual argument to a generic
procedure, MOLD shall be present if the type, type parameters, or rank is
required to resolve the generic reference. MOLD shall also be present if the
reference appears as an actual argument corresponding to a dummy argument with
assumed character length."

---

Someone could also check whether we do the right thing for:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/5a1e0cc2c7eb95cc/


-- 
           Summary: NULL(): Fortran 2003 changes, accepts invalid, ICE on
                    invalid
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, rejects-valid, accepts-invalid,
                    diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
  2007-12-21 10:24 [Bug fortran/34547] New: NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid burnus at gcc dot gnu dot org
@ 2008-01-16 21:36 ` burnus at gcc dot gnu dot org
  2009-03-29  8:19 ` fxcoudert at gcc dot gnu dot org
  2010-05-31 17:36 ` mikael at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-16 21:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-01-16 21:20 -------
See also
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/
for some other possible diagnostic issues.


-- 


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


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
  2007-12-21 10:24 [Bug fortran/34547] New: NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid burnus at gcc dot gnu dot org
  2008-01-16 21:36 ` [Bug fortran/34547] " burnus at gcc dot gnu dot org
@ 2009-03-29  8:19 ` fxcoudert at gcc dot gnu dot org
  2010-05-31 17:36 ` mikael at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-03-29  8:19 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-29 08:19:05
               date|                            |


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


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
  2007-12-21 10:24 [Bug fortran/34547] New: NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid burnus at gcc dot gnu dot org
  2008-01-16 21:36 ` [Bug fortran/34547] " burnus at gcc dot gnu dot org
  2009-03-29  8:19 ` fxcoudert at gcc dot gnu dot org
@ 2010-05-31 17:36 ` mikael at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-05-31 17:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mikael at gcc dot gnu dot org  2010-05-31 17:36 -------
*** Bug 44349 has been marked as a duplicate of this bug. ***


-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zeccav at gmail dot com


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


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
       [not found] <bug-34547-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-09-14  7:21 ` burnus at gcc dot gnu.org
@ 2013-06-25 17:48 ` dominiq at lps dot ens.fr
  3 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-25 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> However, one should go through the lengthy, convoluted thread at
>
> http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/
>to check whether it contains some still-unfixed issues.

The thread is too convoluted for me. Is this still an issue?


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
       [not found] <bug-34547-4@http.gcc.gnu.org/bugzilla/>
  2011-09-14  6:28 ` burnus at gcc dot gnu.org
  2011-09-14  6:29 ` burnus at gcc dot gnu.org
@ 2011-09-14  7:21 ` burnus at gcc dot gnu.org
  2013-06-25 17:48 ` dominiq at lps dot ens.fr
  3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-14  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-14 07:19:03 UTC ---
The patch fixes the issues of comment 0.

However, one should go through the lengthy, convoluted thread at
 
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f014195ccf7b93e6/
to check whether it contains some still-unfixed issues.


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
       [not found] <bug-34547-4@http.gcc.gnu.org/bugzilla/>
  2011-09-14  6:28 ` burnus at gcc dot gnu.org
@ 2011-09-14  6:29 ` burnus at gcc dot gnu.org
  2011-09-14  7:21 ` burnus at gcc dot gnu.org
  2013-06-25 17:48 ` dominiq at lps dot ens.fr
  3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-14  6:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-14 06:26:13 UTC ---
Author: burnus
Date: Wed Sep 14 06:26:07 2011
New Revision: 178841

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178841
Log:
2011-09-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34547
        PR fortran/50375
        * check.c (gfc_check_null): Allow allocatables as MOLD to NULL.
        * resolve.c (resolve_transfer): Reject NULL without MOLD.
        * interface.c (gfc_procedure_use): Reject NULL without MOLD
        if no explicit interface is known.
        (gfc_search_interface): Reject NULL without MOLD if it would
        lead to ambiguity.

2011-09-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34547
        PR fortran/50375
        * gfortran.dg/null_5.f90: New.
        * gfortran.dg/null_6.f90: New.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/34547] NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid
       [not found] <bug-34547-4@http.gcc.gnu.org/bugzilla/>
@ 2011-09-14  6:28 ` burnus at gcc dot gnu.org
  2011-09-14  6:29 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-14  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-14 06:27:30 UTC ---
Author: burnus
Date: Wed Sep 14 06:27:25 2011
New Revision: 178842

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178842
Log:
Really add:

2011-09-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34547
        PR fortran/50375
        * gfortran.dg/null_5.f90: New.
        * gfortran.dg/null_6.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/null_5.f90
    trunk/gcc/testsuite/gfortran.dg/null_6.f90


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

end of thread, other threads:[~2013-06-25 17:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-21 10:24 [Bug fortran/34547] New: NULL(): Fortran 2003 changes, accepts invalid, ICE on invalid burnus at gcc dot gnu dot org
2008-01-16 21:36 ` [Bug fortran/34547] " burnus at gcc dot gnu dot org
2009-03-29  8:19 ` fxcoudert at gcc dot gnu dot org
2010-05-31 17:36 ` mikael at gcc dot gnu dot org
     [not found] <bug-34547-4@http.gcc.gnu.org/bugzilla/>
2011-09-14  6:28 ` burnus at gcc dot gnu.org
2011-09-14  6:29 ` burnus at gcc dot gnu.org
2011-09-14  7:21 ` burnus at gcc dot gnu.org
2013-06-25 17:48 ` dominiq at lps dot ens.fr

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