Bug 18569 - Call to inline function failed
Summary: Call to inline function failed
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-19 20:25 UTC by Jan Engelhardt
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2004-11-19 20:25:37 UTC
	The following code snippet just does not compile (it did in GCC
	3.3.3)

Environment:
System: Linux spartacus 2.6.9 #1 Fri Nov 5 17:15:13 CET 2004 i686 pentium3 i386 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.4.2/configure --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++

How-To-Repeat:
	21:20 spartacus:~ > cat ts.c
	#define INLINE inline __attribute__((always_inline))

	static INLINE void blah(void);

	int main(void) {
	    blah();
	    return 0;
	}

	static INLINE void blah(void) {
	    return;
	}
	21:21 spartacus:~ > gcc ts.c -Wall
	ts.c: In function 
ain':
	ts.c:3: sorry, unimplemented: inlining failed in call to 'blah': function
	body not available
	ts.c:6: sorry, unimplemented: called from here
Comment 1 Jan Engelhardt 2004-11-19 20:25:37 UTC
Fix:
	This can be worked around by placing the function body of blah()
	before any call to it.
Comment 2 Andrew Pinski 2004-11-19 20:37:14 UTC
Invalid as the body is really not available at this point as we are not at unit at a time mode when 
compiling with -O0.