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

            Bug ID: 68846
           Summary: Pointer function as LValue doesn't work when the
                    assignment regards a dummy argument.
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mirco.valentini at polimi dot it
  Target Milestone: ---

Created attachment 36988
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36988&action=edit
A simple program used to expose the bug

! COMPILER VERSION
!==============================================================================
Compiler version:

GNU Fortran (GCC) 6.0.0 20151122 (experimental)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
!==============================================================================

If a function pointer as LValue is used inside a procedure, and the assignment
regards one of the dummy arguments of the procedure what happens is:


1) A stragne error on the INTENT of the dummy argument if it si "INTENT(IN)"
!==============================================================================
     ./test.f90:126:30:

       subgrid%jmp(i,j) = value
                              1

      Error: Dummy argument ‘_F.DA0’ with INTENT(IN) in pointer association
context (pointer assignment) at (1)
!==============================================================================


2) An internal compiler error if the dummy argumet is "INTENT(INOUT)"

Reply via email to