public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c)
@ 2012-09-29 16:10 burnus at gcc dot gnu.org
  2015-10-09 14:06 ` [Bug fortran/54753] " dominiq at lps dot ens.fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-09-29 16:10 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54753
           Summary: assumed-rank dummies: Reject assumed-size actuals in
                    in some cases (C535c)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


In the latest version of DTS 29113 (N1942, N1941), a new constraint was added,
which has to be implemented in gfortran:

Edits to N1917
--------------

In 5.2 Assumed-rank objects, and also at the end of 9.5 Edits to
clause 5, following constraint C535b in both subclauses, add a new
constraint:

"C535c If an assumed-size or nonallocatable nonpointer assumed-rank
array is an actual argument corresponding to a dummy argument that is
an INTENT(OUT) assumed-rank array, it shall not be polymorphic,
finalizable, of a type with an allocatable ultimate component, or of a
type for which default initialization is specified."


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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
@ 2015-10-09 14:06 ` dominiq at lps dot ens.fr
  2021-03-01  8:04 ` [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839) burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09 14:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-09
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
>From my copy of the f2015 draft

C540 If an assumed-size or nonallocatable nonpointer assumed-rank array
     is an actual argument that corresponds to a dummy argument that
     is an INTENT (OUT) assumed-rank array, it shall not be polymorphic,
     finalizable, of a type with an allocatable ultimate component,
     or of a type for which default initialization is specified.


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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
  2015-10-09 14:06 ` [Bug fortran/54753] " dominiq at lps dot ens.fr
@ 2021-03-01  8:04 ` burnus at gcc dot gnu.org
  2021-07-05 22:18 ` sandra at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-01  8:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|assumed-rank dummies:       |assumed-rank dummies:
                   |Reject assumed-size actuals |Reject assumed-size actuals
                   |in in some cases (C535c)    |in in some cases (C535c; in
                   |                            |F2018: C839)

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
In F2018:

C839 If an assumed-size or nonallocatable nonpointer assumed-rank array is an
actual argument that corres-19ponds to a dummy argument that is an INTENT (OUT)
assumed-rank array, it shall not be polymorphic,20finalizable, of a type with
an allocatable ultimate component, or of a type for which default
initialization21is specified.

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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
  2015-10-09 14:06 ` [Bug fortran/54753] " dominiq at lps dot ens.fr
  2021-03-01  8:04 ` [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839) burnus at gcc dot gnu.org
@ 2021-07-05 22:18 ` sandra at gcc dot gnu.org
  2021-10-04  7:38 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-07-05 22:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sandra at gcc dot gnu.org

--- Comment #3 from sandra at gcc dot gnu.org ---
I've encountered problems related to this constraint in my WIP TS29113
testsuite, too.

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574115.html

This is the types/c535c-*.f90 tests.

The wording of the constraint is really confusing to me.  I've parsed it to
mean that the "it" being referred to as the subject of the requirements in the
second half of the sentence is the actual argument, not the dummy argument.

c535c-1 is emitting a nonsensical diagnostic on the subroutine definition
instead of meaningful diagnostics at the invalid call sites.

c535c-2 is failing to produce diagnostics.

c535c-3 and c535c-4 are dying with internal compiler errors.

Of course it is possible that my Fortran code is buggy as well as my parsing of
the constraint.  :-S

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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-05 22:18 ` sandra at gcc dot gnu.org
@ 2021-10-04  7:38 ` cvs-commit at gcc dot gnu.org
  2021-10-07 15:17 ` sandra at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-04  7:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:51d9ef7747b2dc439f7456303f0784faf5cdb1d3

commit r12-4107-g51d9ef7747b2dc439f7456303f0784faf5cdb1d3
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Oct 4 09:38:43 2021 +0200

    Fortran: Avoid var initialization in interfaces [PR54753]

    Intent(out) implies deallocation/default initialization; however, it is
    pointless to do this for dummy-arguments symbols of procedures which are
    inside an INTERFACE block. â This also fixes a bogus error for the
attached
    included testcase, but fixing the non-interface version still has to be
done.

            PR fortran/54753

    gcc/fortran/ChangeLog:

            * resolve.c (can_generate_init, resolve_fl_variable_derived,
            resolve_symbol): Only do initialization with intent(out) if not
            inside of an interface block.

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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-04  7:38 ` cvs-commit at gcc dot gnu.org
@ 2021-10-07 15:17 ` sandra at gcc dot gnu.org
  2021-10-08 21:31 ` cvs-commit at gcc dot gnu.org
  2021-10-21 21:13 ` sandra at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-10-07 15:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

--- Comment #5 from sandra at gcc dot gnu.org ---
Patch to add the diagnostic posted here:

https://gcc.gnu.org/pipermail/fortran/2021-October/056656.html

There's still a problem with the bogus diagnostic arising from
deallocation/initialization when you have just a subroutine definition instead
of an interface.  That has nothing to do with this diagnostic or other
caller/callee argument mismatch so I opened a new issue (PR102641) for that.

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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-10-07 15:17 ` sandra at gcc dot gnu.org
@ 2021-10-08 21:31 ` cvs-commit at gcc dot gnu.org
  2021-10-21 21:13 ` sandra at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-08 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>:

https://gcc.gnu.org/g:7afb61087d2cb7a6d27463bab5a7567fac69f97a

commit r12-4257-g7afb61087d2cb7a6d27463bab5a7567fac69f97a
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Fri Oct 8 14:29:12 2021 -0700

    Fortran: Add diagnostic for F2018:C839 (TS29113:C535c)

    2021-10-08 Sandra Loosemore  <sandra@codesourcery.com>

            PR fortran/54753

    gcc/fortran/
            * interface.c (gfc_compare_actual_formal): Add diagnostic
            for F2018:C839.  Refactor shared code and fix bugs with class
            array info lookup, and extend similar diagnostic from PR94110
            to also cover class types.

    gcc/testsuite/
            * gfortran.dg/c-interop/c535c-1.f90: Rewrite and expand.
            * gfortran.dg/c-interop/c535c-2.f90: Remove xfails.
            * gfortran.dg/c-interop/c535c-3.f90: Likewise.
            * gfortran.dg/c-interop/c535c-4.f90: Likewise.
            * gfortran.dg/PR94110.f90: Extend to cover class types.

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

* [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839)
  2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-10-08 21:31 ` cvs-commit at gcc dot gnu.org
@ 2021-10-21 21:13 ` sandra at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-10-21 21:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54753

sandra at gcc dot gnu.org changed:

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

--- Comment #7 from sandra at gcc dot gnu.org ---
This has been fixed except for the problem with deallocation/initialization of
assumed-rank arrays now being tracked separately in PR102641.

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

end of thread, other threads:[~2021-10-21 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-29 16:10 [Bug fortran/54753] New: assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c) burnus at gcc dot gnu.org
2015-10-09 14:06 ` [Bug fortran/54753] " dominiq at lps dot ens.fr
2021-03-01  8:04 ` [Bug fortran/54753] assumed-rank dummies: Reject assumed-size actuals in in some cases (C535c; in F2018: C839) burnus at gcc dot gnu.org
2021-07-05 22:18 ` sandra at gcc dot gnu.org
2021-10-04  7:38 ` cvs-commit at gcc dot gnu.org
2021-10-07 15:17 ` sandra at gcc dot gnu.org
2021-10-08 21:31 ` cvs-commit at gcc dot gnu.org
2021-10-21 21:13 ` sandra at gcc dot gnu.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).