This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++: inlining issues
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C++: inlining issues
- From: Martin Reinecke <martin at MPA-Garching dot MPG dot DE>
- Date: Mon, 06 Dec 1999 13:07:41 +0100
- Organization: Max-Planck-Institut fuer Astrophysik
Hi!
I'm almost sure you are aware of the problem, but I thought a bug report
couldn't hurt:
Consider the following code:
class foo
{
public:
float x;
foo (float xval)
: x (xval) {}
foo operator+ (const foo &foo2) const
{ return foo (x+foo2.x); }
};
int main()
{
foo f=foo(1)+foo(2);
}
The current compiler (CVS 991206 with inlining on trees still enabled) gives the following output:
~/temp>/afs/mpa/data/martin/egcscvs/bin/g++ -v
Reading specs from /afs/mpa/data/martin/egcscvs/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19991206 (experimental)
~/temp>/afs/mpa/data/martin/egcscvs/bin/g++ -O2 -Winline test.cxx
test.cxx: In function `int main ()':
test.cxx:10: warning: can't inline call to `foo foo::operator + (const foo &) const'
test.cxx:15: warning: called from here
test.cxx:7: warning: can't inline call to `foo::foo (float)'
test.cxx:15: warning: called from here
This seems like a regression.
Cheers,
Martin