Bug 33564 - A static inline function as a parameter of another static inline function is not inlined.
Summary: A static inline function as a parameter of another static inline function is ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.2
: P3 enhancement
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks:
 
Reported: 2007-09-26 14:26 UTC by Michael Ferguson
Modified: 2007-09-26 14:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.2.2
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Ferguson 2007-09-26 14:26:02 UTC
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 ) );
}
Comment 1 Richard Biener 2007-09-26 14:49:46 UTC
Fixed in 4.3.0.