[Bug c++/30637] The options -fno-unit-at-a-time and -finline-functions generates erroneous code
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Feb 9 01:17:00 GMT 2007
------- Comment #6 from reichelt at gcc dot gnu dot org 2007-02-09 01:16 -------
The bug has nothing to do with -fno-unit-at-a-time.
(It is ignored for C++ anyways.)
The bug is fixed since GCC 4.0.0.
Btw, here's a shorter self-contained program that hangs when compiled with
"g++ -O -finline-functions" by GCC 3.4.x:
====================================
struct A
{
virtual void FOO() {}
};
struct B
{
A* p;
B() : p(new A) {}
A* foo();
void bar();
};
A* B::foo()
{
return p;
}
void B::bar()
{
foo()->FOO();
}
int main()
{
B().bar();
return 0;
}
====================================
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30637
More information about the Gcc-bugs
mailing list