This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/34949] New: Dead code in trivial destructors.
- From: "spark at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2008 23:09:28 -0000
- Subject: [Bug middle-end/34949] New: Dead code in trivial destructors.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
# cat dead.cpp
class Foo
{
public:
virtual ~Foo();
};
Foo::~Foo()
{
}
# g++ -O2 -S dead.cpp
# cat dead.cpp
...
.globl _ZN3FooD2Ev
.type _ZN3FooD2Ev, @function
_ZN3FooD2Ev:
.LFB3:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
movl 8(%ebp), %eax
movl $_ZTV3Foo+8, (%eax)
popl %ebp
ret
.LFE3:
.size _ZN3FooD2Ev, .-_ZN3FooD2Ev
...
In this trivial case (which is actually quite common),
there's no need for the store to update the vtable pointer,
since there's nothing to do in this destructor.
--
Summary: Dead code in trivial destructors.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: spark at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34949