Bug 31494 - spurious error: PROCEDURE attribute conflicts with DIMENSION attribute
Summary: spurious error: PROCEDURE attribute conflicts with DIMENSION attribute
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Paul Thomas
URL:
Keywords: rejects-valid
Depends on: 30746
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-06 17:21 UTC by Michael Richmond
Modified: 2007-06-25 18:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-06-25 14:56:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Richmond 2007-04-06 17:21:51 UTC
When I compile the module listed below I get the following message:

k.f90:5.13:
    CALL sub2
            1
Error: PROCEDURE attribute conflicts with DIMENSION attribute in 'sub2' at (1)

It resembles Bug 24633. However, g95 and Lahey regard 24633 as an error but do not regard this as an error.

MODULE ksbin2_aux_mod
REAL, DIMENSION(1) :: sub2
CONTAINS
  SUBROUTINE sub1
    CALL sub2
    CONTAINS 
      SUBROUTINE sub2
      END SUBROUTINE sub2
  END SUBROUTINE sub1
END MODULE ksbin2_aux_mod
Comment 1 Paul Thomas 2007-04-08 19:49:38 UTC
Confirmed
> 
> It resembles Bug 24633. However, g95 and Lahey regard 24633 as an error but do
> not regard this as an error.

In actual fact, it is the same as pr30746.  Both make wrong host associations, when doubly contained procedures are at play.  gfortran and, to some degree, g95 deny the possibility of such a thing:)

I have been thinking about how best to fix pr30746 and will add this one to my reflections.

Thanks for the report.

Paul
Comment 2 Paul Thomas 2007-05-22 09:07:32 UTC
(In reply to comment #1)

> I have been thinking about how best to fix pr30746 and will add this one to my
> reflections.

I fixed 30746 but this PR remains. It is, if anything, a bit more difficult because there is at least one further error behind the one that you report.

*sigh*

Paul
Comment 3 patchapp@dberlin.org 2007-06-24 19:10:15 UTC
Subject: Bug number PR31494

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01812.html
Comment 4 Paul Thomas 2007-06-25 14:56:35 UTC
I'd better take this on since I have had my patch for it accepted!

Thanks for the report, Michael.

Paul
Comment 5 Paul Thomas 2007-06-25 18:28:21 UTC
Subject: Bug 31494

Author: pault
Date: Mon Jun 25 18:27:59 2007
New Revision: 126000

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126000
Log:
2007-06-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/32464
	* resolve.c (check_host_association): Return if the old symbol
	is use associated.  Introduce retval to reduce the number of
	evaluations of the first-order return value.

	PR fortran/31494
	* match.c (gfc_match_call): If a host associated symbol is not
	a subroutine, build a new symtree/symbol in the current name
	space.


2007-06-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/32464
	* gfortran.dg/host_assoc_function_2.f90: New test.

	PR fortran/31494
	* gfortran.dg/host_assoc_call_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/host_assoc_call_1.f90
    trunk/gcc/testsuite/gfortran.dg/host_assoc_function_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog

Comment 6 Paul Thomas 2007-06-25 18:28:53 UTC
Fixed on trunk.

Paul