public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39695]  New: ProcPtr function results: wrong name in error message
@ 2009-04-09 11:47 janus at gcc dot gnu dot org
  2009-06-26 12:18 ` [Bug fortran/39695] [F03] " janus at gcc dot gnu dot org
  2009-12-17 21:05 ` pault at gcc dot gnu dot org
  0 siblings, 2 replies; 10+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-09 11:47 UTC (permalink / raw)
  To: gcc-bugs

For procedure pointer results without an explicit RESULT statement, error
messages may contain the wrong name (since a hidden result variable named
'ppr@' is added).

Examples:

function f()
  pointer :: f
  interface
    integer function f(x) bind(c)   ! "may not be a C interoperable kind"
      integer :: x
    end function
  end interface
end function

function g()
  interface
    subroutine g()
    end subroutine g
  end interface
  pointer g
  real g   ! "cannot have a type"
end function


On a related note: In the following example the name is right, but the error
message appears twice.

function h()
  interface
    integer function h(x)   ! "is missing the pointer attribute" (twice!)
      integer :: x
    end function
  end interface
end function


-- 
           Summary: ProcPtr function results: wrong name in error message
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


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


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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
  2009-04-09 11:47 [Bug fortran/39695] New: ProcPtr function results: wrong name in error message janus at gcc dot gnu dot org
@ 2009-06-26 12:18 ` janus at gcc dot gnu dot org
  2009-12-17 21:05 ` pault at gcc dot gnu dot org
  1 sibling, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-06-26 12:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from janus at gcc dot gnu dot org  2009-06-26 12:18 -------
Another test case for this can be found in PR40541:

program test
  procedure(real), pointer :: p
  p => f()  ! << Invalid f() returns a LOGICAL(1) function, but p is a REAL one
contains
 function f()
   pointer :: f
   interface
     logical(1) function f()
     end function
   end interface
   f = .true._1
 end function f
end program test


-- 


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


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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
  2009-04-09 11:47 [Bug fortran/39695] New: ProcPtr function results: wrong name in error message janus at gcc dot gnu dot org
  2009-06-26 12:18 ` [Bug fortran/39695] [F03] " janus at gcc dot gnu dot org
@ 2009-12-17 21:05 ` pault at gcc dot gnu dot org
  1 sibling, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-12-17 21:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

pault 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-12-17 21:05:39
               date|                            |


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


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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2020-05-20 14:43 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20 14:44 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 10+ messages in thread
From: markeggleston at gcc dot gnu.org @ 2020-05-20 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

markeggleston at gcc dot gnu.org changed:

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

--- Comment #11 from markeggleston at gcc dot gnu.org ---
Committed to master and backported.

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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-05-20 14:07 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20 14:43 ` cvs-commit at gcc dot gnu.org
  2020-05-20 14:44 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:15e518600a9ef82b55d2ec75d8d41d767132f475

commit r8-10261-g15e518600a9ef82b55d2ec75d8d41d767132f475
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu May 7 08:02:02 2020 +0100

    Fortran  : ProcPtr function results: 'ppr@' in error message PR39695

    The value 'ppr@' is set in the name of result symbol, the actual
    name of the symbol is in the procedure name symbol pointed
    to by the result symbol's namespace (ns). When reporting errors for
    symbols that have the proc_pointer attribute check whether the
    result attribute is set and set the name accordingly.

    Backport from master.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran/

            PR fortran/39695
            * resolve.c (resolve_fl_procedure): Set name depending on
            whether the result attribute is set.  For PROCEDURE/RESULT
            conflict use the name in sym->ns->proc_name->name.
            * symbol.c (gfc_add_type): Add check for function and result
            attributes use sym->ns->proc_name->name if both are set.
            Where the symbol cannot have a type use the name in
            sym->ns->proc_name->name.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/39695
            * gfortran.dg/pr39695_1.f90: New test.
            * gfortran.dg/pr39695_2.f90: New test.
            * gfortran.dg/pr39695_3.f90: New test.
            * gfortran.dg/pr39695_4.f90: New test.

            (cherry picked from commit
eb069ae8819c3a84d7f78becc5501e21ee3a9554)

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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-05-20 13:51 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20 14:07 ` cvs-commit at gcc dot gnu.org
  2020-05-20 14:43 ` cvs-commit at gcc dot gnu.org
  2020-05-20 14:44 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

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

commit r9-8608-g7c9bfd404691e5dac7e32830ae6d9726ccf59683
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu May 7 08:02:02 2020 +0100

    Fortran  : ProcPtr function results: 'ppr@' in error message PR39695

    The value 'ppr@' is set in the name of result symbol, the actual
    name of the symbol is in the procedure name symbol pointed
    to by the result symbol's namespace (ns). When reporting errors for
    symbols that have the proc_pointer attribute check whether the
    result attribute is set and set the name accordingly.

    Backported from master.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran/

            PR fortran/39695
            * resolve.c (resolve_fl_procedure): Set name depending on
            whether the result attribute is set.  For PROCEDURE/RESULT
            conflict use the name in sym->ns->proc_name->name.
            * symbol.c (gfc_add_type): Add check for function and result
            attributes use sym->ns->proc_name->name if both are set.
            Where the symbol cannot have a type use the name in
            sym->ns->proc_name->name.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/39695
            * gfortran.dg/pr39695_1.f90: New test.
            * gfortran.dg/pr39695_2.f90: New test.
            * gfortran.dg/pr39695_3.f90: New test.
            * gfortran.dg/pr39695_4.f90: New test.

            (cherry picked from commit
eb069ae8819c3a84d7f78becc5501e21ee3a9554)

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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-05-20 13:28 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20 13:51 ` cvs-commit at gcc dot gnu.org
  2020-05-20 14:07 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:8358ac9bbc57d6986c9bd5dd17c0331a60114f45

commit r10-8160-g8358ac9bbc57d6986c9bd5dd17c0331a60114f45
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu May 7 08:02:02 2020 +0100

    Fortran  : ProcPtr function results: 'ppr@' in error message PR39695

    The value 'ppr@' is set in the name of result symbol, the actual
    name of the symbol is in the procedure name symbol pointed
    to by the result symbol's namespace (ns). When reporting errors for
    symbols that have the proc_pointer attribute check whether the
    result attribute is set and set the name accordingly.

    Backported from master.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran/

            PR fortran/39695
            * resolve.c (resolve_fl_procedure): Set name depending on
            whether the result attribute is set.  For PROCEDURE/RESULT
            conflict use the name in sym->ns->proc_name->name.
            * symbol.c (gfc_add_type): Add check for function and result
            attributes use sym->ns->proc_name->name if both are set.
            Where the symbol cannot have a type use the name in
            sym->ns->proc_name->name.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/39695
            * gfortran.dg/pr39695_1.f90: New test.
            * gfortran.dg/pr39695_2.f90: New test.
            * gfortran.dg/pr39695_3.f90: New test.
            * gfortran.dg/pr39695_4.f90: New test.

            (cherry picked from commit
eb069ae8819c3a84d7f78becc5501e21ee3a9554)

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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
  2013-12-09 14:23 ` janus at gcc dot gnu.org
  2013-12-09 14:33 ` janus at gcc dot gnu.org
@ 2020-05-20 13:28 ` cvs-commit at gcc dot gnu.org
  2020-05-20 13:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:eb069ae8819c3a84d7f78becc5501e21ee3a9554

commit r11-524-geb069ae8819c3a84d7f78becc5501e21ee3a9554
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu May 7 08:02:02 2020 +0100

    Fortran  : ProcPtr function results: 'ppr@' in error message PR39695

    The value 'ppr@' is set in the name of result symbol, the actual
    name of the symbol is in the procedure name symbol pointed
    to by the result symbol's namespace (ns). When reporting errors for
    symbols that have the proc_pointer attribute check whether the
    result attribute is set and set the name accordingly.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran/

            PR fortran/39695
            * resolve.c (resolve_fl_procedure): Set name depending on
            whether the result attribute is set.  For PROCEDURE/RESULT
            conflict use the name in sym->ns->proc_name->name.
            * symbol.c (gfc_add_type): Add check for function and result
            attributes use sym->ns->proc_name->name if both are set.
            Where the symbol cannot have a type use the name in
            sym->ns->proc_name->name.

    2020-05-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/39695
            * gfortran.dg/pr39695_1.f90: New test.
            * gfortran.dg/pr39695_2.f90: New test.
            * gfortran.dg/pr39695_3.f90: New test.
            * gfortran.dg/pr39695_4.f90: New test.

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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
  2013-12-09 14:23 ` janus at gcc dot gnu.org
@ 2013-12-09 14:33 ` janus at gcc dot gnu.org
  2020-05-20 13:28 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-09 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from janus at gcc dot gnu.org ---
As noted by Dominique in comment 2:

Comment 1 is fixed since 4.8, and out of the three cases in comment 0 only the
second one persists (together with comment 3).


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

* [Bug fortran/39695] [F03] ProcPtr function results: wrong name in error message
       [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
@ 2013-12-09 14:23 ` janus at gcc dot gnu.org
  2013-12-09 14:33 ` janus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-09 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from janus at gcc dot gnu.org ---
Another example: proc_ptr_result_4.f90 in the testsuite yields the following
error since 4.9 (see also PR59428):

    procedure(sin), pointer :: f
                                1
Error: Procedure pointer 'ppr@' at (1) shall not be elemental



  function f()
    intrinsic :: sin
    procedure(sin), pointer :: f
    f => sin
  end function f


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

end of thread, other threads:[~2020-05-20 14:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-09 11:47 [Bug fortran/39695] New: ProcPtr function results: wrong name in error message janus at gcc dot gnu dot org
2009-06-26 12:18 ` [Bug fortran/39695] [F03] " janus at gcc dot gnu dot org
2009-12-17 21:05 ` pault at gcc dot gnu dot org
     [not found] <bug-39695-4@http.gcc.gnu.org/bugzilla/>
2013-12-09 14:23 ` janus at gcc dot gnu.org
2013-12-09 14:33 ` janus at gcc dot gnu.org
2020-05-20 13:28 ` cvs-commit at gcc dot gnu.org
2020-05-20 13:51 ` cvs-commit at gcc dot gnu.org
2020-05-20 14:07 ` cvs-commit at gcc dot gnu.org
2020-05-20 14:43 ` cvs-commit at gcc dot gnu.org
2020-05-20 14:44 ` markeggleston 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).