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 c/33564] New: A static inline function as a parameter of another static inline function is not inlined.


This is a duplicate of bug 1601, which I can't reopen.

This bug is still present on 4.1.2-13 (RedHat, 20070626) and 3.4.6-3 (RedHat
20060404). Looking at the produced assembly, f2 and fun are both produced; the
assembly should only produce fun and inline both f1 and f2. I havn't tested it
on 4.2.1 yet, but I'm reopening it because it was reported as fixed years ago.
I'm compiling the test given below with:
gcc -c -O3 --save-temps inline_test.c

How-To-Repeat (from bug 1601):
static inline int
f1( int (*f)(int y), int q )
{
  return( (*f)( q ) );
}

static inline int
f2( int z )
{
  return( z ^ 32 );
}

int fun( int x )
{
  return( f1( &f2, x ) );
}


-- 
           Summary: A static inline function as a parameter of another
                    static inline function is not inlined.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michaelferguson at acm dot org


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


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