This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19639] Funny (horrible) code for empty destructor
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Feb 2005 09:52:07 -0000
- Subject: [Bug tree-optimization/19639] Funny (horrible) code for empty destructor
- References: <20050126134950.19639.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-02-16 09:52 -------
With PR15791 fixed we now create at -O2
void foo() ()
{
struct Foo * const this.6;
struct Foo * D.1654;
struct Foo * const this;
register struct Foo * D.1634;
struct Foo[2] * D.1633;
struct NonPod x;
<bb 0>:
this = &x.foo[2];
<L2>:;
this = this - 4;
D.1654 = 0B;
if (D.1654 + this == &x.foo) goto <L6>; else goto <L2>;
<L6>:;
return;
}
With PR19807 fixed (patch in testing) we're down to
void foo() ()
{
unsigned int ivtmp.1;
struct Foo * pretmp.0;
struct Foo * const this;
register struct Foo * D.1634;
struct Foo[2] * D.1633;
struct NonPod x;
<bb 0>:
ivtmp.1 = 2;
<L2>:;
ivtmp.1 = ivtmp.1 - 1;
if (ivtmp.1 == 0) goto <L6>; else goto <L2>;
<L6>:;
return;
}
which is PR17640 and the tree-unroller will happily unroll and optimize
to an empty function (before fixing PR19807 it wouldn't do that).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19639