gcc 3.0.x problem with -fkeep-inline-functions

gcc 3.0.x problem with -fkeep-inline-functions

Post by Mathias Waac » Tue, 26 Feb 2002 21:23:51



Hi all,

I have a class like this:

namespace A {
class B {
public:
  ...
  void do_one(int) throw();
  void do_two() throw() { do_one(42); }

Quote:};
}

Compiling a (slightly larger) project containing some .cpp files which
include the header defining the class above results in the error:

/opt/experimental/include/g++-v3/i686-pc-linux-gnu/bits/gthr-single.h:225:
undefined reference to `A::B::do_one(int)'

It must be noted that none of the .cpp files create an instance of this
class (the header contains some typedefs which are used). After removing
the -fkeep-inline-functions switch from the command line, the project
compiles. It compiles too if I move the body of do_two into a .cpp file.
And it compiles with gcc 2.95.3, even with the -fkeep-inline-functions
switch.

Unfortunatly I wasn't able to reproduce this with a smaller example.
Anybody knows whats going wrong?

Mathias

--

Tel.:  +49 621 181 2717  Fax.:  +49 621 181 2713

 
 
 

1. Inline math function expansion by GCC's optimization?

Hi,

I have a program which works well under gcc 2.91.66. Today I switched to gcc
2.96, but it says it cannot found pow() function in linking process.

So I tried to play with compiler options to see what happened. My program
was complied with -O2 optimization, and with 2.91.66, the pow() function is
optimized with internal inline functions. In other words, the pow() function
is replaced by internal inline expansion rather than linked against the
standard library.

However, with 2.96, no matter what optimzation level I specify, the pow()
function is never inlined by the compiler.

My question is, is there any compiler option which can turn on math function
inline expansion for 2.96?

Frank.

2. @Home Cable Modem and Linux

3. __asm__ inline assembler problem in GCC

4. bash script help

5. "extern inline" to "static inline" allows compile

6. can i ftp multiple dir at once

7. static inline, and extern inline in the kernel source

8. lilo problems

9. why is "static inline" preferred over "extern inline"?

10. keep data private in inline functions

11. SUN CC 5.0: shared libraries refuse to close - missing inline template functions!

12. gdb can't locate breakpoint of inline function

13. macro in inline function bahaves weirdly