This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/15345] New: unreferenced nested inline functions not optimized away
- From: "dank at kegel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2004 17:26:08 -0000
- Subject: [Bug optimization/15345] New: unreferenced nested inline functions not optimized away
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On gcc-3.4.0, unreferenced nested inline functions are not
optimized away at -O0 or -O1. This is a regression from gcc-2.95.x and gcc-3.2.2.
This breaks building glibc-2.3.2 for sparc64 (see
http://sources.redhat.com/ml/libc-alpha/2004-05/msg00066.html)
No idea why it doesn't break other architectures.
Here's a small test case:
void f(void)
{
inline int g(void) {
extern int should_be_optimized_away(void);
return should_be_optimized_away();
}
}
Compile with -S, then examine the .s file; you'll
see a reference to should_be_optimized_away that shouldn't be there.
--
Summary: unreferenced nested inline functions not optimized away
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dank at kegel dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15345