This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29648] Inlining only done for contained procedures



------- Comment #3 from bdavis at gcc dot gnu dot org  2007-12-01 02:24 -------
in case someone does not know what a contained procedure is (i sure didn't
without getting out the Metcalf and Reid book), below is an example:

       program fred
       integer j
       j = 0
       call a(j)
       print*,j
       contains
       subroutine a(i)
       integer i
       i = i +2
       end subroutine a
       end program fred

compile it with no optimization and look at the assembler code, then compile it
with -O2, the subroutine is inlined by gfortran.

not really relevant to this PR, but something I learned and verified, which
might be of use.

--bud


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29648


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]