[Bug optimization/15345] New: unreferenced nested inline functions not optimized away

dank at kegel dot com gcc-bugzilla@gcc.gnu.org
Sun May 9 17:26:00 GMT 2004


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



More information about the Gcc-bugs mailing list