This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Function Inlining for FORTRAN
- From: Canqun Yang <canqun at nudt dot edu dot cn>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: Steven Bosscher <stevenb at suse dot de>, fortran at gcc dot gnu dot org,gcc at gcc dot gnu dot org
- Date: Fri, 22 Jul 2005 10:44:57 +0800 (HKT)
- Subject: Re: Function Inlining for FORTRAN
- References: <20050720143531.A56FA53C536@ds20.nudt.edu.cn> <200507201622.54155.paul@codesourcery.com>
- Reply-to: Canqun Yang <canqun at nudt dot edu dot cn>
Paul Brook <paul@codesourcery.com>:
> On Wednesday 20 July 2005 15:35, Canqun Yang wrote:
> > Hi, all
> >
> > Function inlining for FORTRAN programs always fails.
>
> Not entirely true. Inlining of contained procedures works fine (or it did la
> st
> time I checked). This should include inlining of siblings within a module.
>
> > If no one engages in it, I will give a try. Would you please give me
> > some clues?
>
> The problem is that each top level program unit (PU)[1] is compiled
> separately. Each PU has it's own "external" decls for all function calls,
> even if the function happens to be in the same function. Thus each PU is an
>
> isolated self-contained tree structure, and the callgraph doesn't know the
> definition and declaration are actually the same thing.
>
> Basically what you need to do is parse the whole file, then start generating
>
> code.
>
> Unfortunately this isn't simple (or it would have been fixed already!).
> Unlike C Fortran doesn't have file-level scope. It makes absolutely no
> difference whether two procedures are in the same file, or in different
> files. You get all the problems that multifile IPA in C experiences within
> a
> single Fortran file.
>
> The biggest problem is type consistency and aliasing. Consider the following
>
I have several FORTRAN 77 programs. After inlining the small functions in them by hand, they
made a great performance improvements. So I need a trial implementation of function inlining to
verify the effectiveness of it.
Now, my question is: If we just take the FORTRAN 77 syntax into account (no derived types, no
complex aliasing), may it be simpler to implement function inlining for FORTRAN 77.
>
> Paul
>
Canqun Yang
Creative Compiler Research Group.
National University of Defense Technology, China.