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/33344] if(!z) {a.b = x->b + 1; z = &a; } else if (!x) { a.b = z->b+1; x = &a; } use z->b and x->b; is not optimized



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-04-03 11:40 -------
Fixed with the alias-improvements branch merge.

g (struct f * b, struct f * c)
{
  int prephitmp.20;
  int prephitmp.19;

<bb 2>:
  if (b == 0B)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  prephitmp.19 = c->a;
  prephitmp.20 = prephitmp.19 + 1;
  goto <bb 7>;

<bb 4>:
  if (c == 0B)
    goto <bb 6>;
  else
    goto <bb 5>;

<bb 5>:
  prephitmp.19 = c->a;
  prephitmp.20 = b->a;
  goto <bb 7>;

<bb 6>:
  prephitmp.20 = b->a;
  prephitmp.19 = prephitmp.20 + 1;

<bb 7>:
  return prephitmp.20 + prephitmp.19;

}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33344


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