This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/19639] Funny (horrible) code for empty destructor


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]