Bug 40976 - Merge DECL of procedure call with DECL of gfc_get_function_type
Summary: Merge DECL of procedure call with DECL of gfc_get_function_type
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic, wrong-code
Depends on: 33097 91390 91443
Blocks: 42361 40949 87689
  Show dependency treegraph
 
Reported: 2009-08-05 19:46 UTC by Tobias Burnus
Modified: 2021-12-21 02:59 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-08-05 20:43:11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2009-08-05 19:46:14 UTC
Motivated by PR 40969.

Currently, we generate a function declaration for

  procedure(<empty or interface>) :: proc

and another one for
  call proc(something) ! or var = proc(something)

If no explicit interface is known, the function argument is undefined, which causes problems with LTO, cf. PR 40949 and PR 40969.

In principle, one could update the formal argument list of the "proc" symbol when encountering the procedure call. That should be already done in the front end and will also provide a means of diagnosing call errors such as:

   call proc(4)
   call proc(4.0, 4) ! wrong type, different number of arguments

Additionally, one should then re-use the DECL.
Comment 1 Tobias Burnus 2009-08-05 20:43:11 UTC
See also vaguely related PR 40978.
Comment 2 Tobias Burnus 2009-08-18 13:03:36 UTC
Another complication is due to:

a) Procedure pointer
b) Procedure pointer components

(Type-bound procedures are no problem as they have always an explicit interface.)
Comment 3 Tobias Burnus 2009-08-18 14:49:58 UTC
For PPC, see also PR 41107 and the link therein.
Comment 4 Dominique d'Humieres 2010-03-02 10:37:57 UTC
Could pr41056 be related to this one?
Comment 5 janus 2012-04-26 14:09:28 UTC
I think PR42122 is possibly related ...
Comment 6 Thomas Koenig 2019-08-14 08:31:17 UTC
I will look at this for a bit. However, if anybody wants to work on this, be my guest.
Comment 7 Thomas Koenig 2019-08-14 10:15:33 UTC
*** Bug 91390 has been marked as a duplicate of this bug. ***