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 tree-optimization/34940] New: contained subroutines called only once are not inlined


contained subroutines called only once are not inlined, despite the fact that
it is always a win (independent of the size of the contained subroutine). It
'only requires' counting the number of calls to cs1 in the routine s1, if it is
1, it should be inlined, as there can not be other callers.

example that shows no inlining at -O3 with 
GNU Fortran (GCC) 4.3.0 20080121 (experimental) [trunk revision 131689]

SUBROUTINE S1(X)
  CALL CS1(X)
CONTAINS
  SUBROUTINE CS1(X)
     CALL RANDOM_NUMBER(X)
     WRITE(6,*) X
  END SUBROUTINE CS1
END SUBROUTINE S1


-- 
           Summary: contained subroutines called only once are not inlined
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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