Re: Function pointers to a nested function / contained procedure

2019-03-27 Thread Richard Biener
On Wed, Mar 27, 2019 at 10:09 AM Jakub Jelinek wrote: > > On Wed, Mar 27, 2019 at 10:02:21AM +0100, Richard Biener wrote: > > On Wed, Mar 27, 2019 at 8:48 AM Thomas König wrote: > > > > > > Hi Eric, > > > > There is an entire machinery in the middle-end and the back-ends to > > > > support this

Re: Function pointers to a nested function / contained procedure

2019-03-27 Thread Jakub Jelinek
On Wed, Mar 27, 2019 at 10:02:21AM +0100, Richard Biener wrote: > On Wed, Mar 27, 2019 at 8:48 AM Thomas König wrote: > > > > Hi Eric, > > > There is an entire machinery in the middle-end and the back-ends to > > > support this (look for trampolines/descriptors in the manual and the > > > source

Re: Function pointers to a nested function / contained procedure

2019-03-27 Thread Richard Biener
On Wed, Mar 27, 2019 at 8:48 AM Thomas König wrote: > > Hi Eric, > > There is an entire machinery in the middle-end and the back-ends to support > > this (look for trampolines/descriptors in the manual and the source code). > > This should essentially work out of the box for any language front-e

Re: Function pointers to a nested function / contained procedure

2019-03-27 Thread Thomas König
Hi Eric, > There is an entire machinery in the middle-end and the back-ends to support > this (look for trampolines/descriptors in the manual and the source code). > This should essentially work out of the box for any language front-end. Thanks for the pointer. The documentation I have seen seems

Re: Function pointers to a nested function / contained procedure

2019-03-26 Thread Eric Botcazou
> At the moment, I am at a loss of how to try to fix this. Any ideas? > Is there any other language which has such a feature, so a bit of > judicious copy & paste could be applied? (GNU) C and Ada since the dawn of time. There is an entire machinery in the middle-end and the back-ends to suppor

Function pointers to a nested function / contained procedure

2019-03-26 Thread Thomas Koenig
Hello world, Fortran allows pointers to contained procedures (other languages might call this nested functions), and also allows them to be called using procedure pointers (function pointers in C). This is permitted as long as the host instance is still active (the parent function is still runni