This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34940] New: contained subroutines called only once are not inlined
- From: "jv244 at cam dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2008 11:12:54 -0000
- Subject: [Bug tree-optimization/34940] New: contained subroutines called only once are not inlined
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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