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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |52115

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-06 
14:13:48 UTC ---
On ppc the main SRA pass does nothing to foo () because of differences in
how the return value is returned.  Still the IL at expansion time looks
great:

foo ()
{
<bb 2>:
  <retval>.b = 1;
  use_bool (<retval>);
  <retval>.i = 65534;
  return <retval>;

}

compared to x86_64 where we have the uglier

foo ()
{
  union U u;
  union U D.1733;

<bb 2>:
  u.b = 1;
  use_bool (u);
  u = VIEW_CONVERT_EXPR<union U>(65534);
  D.1733 = u;
  u ={v} {CLOBBER};
  return D.1733;

Compared to -fno-tree-sra on PPC we have

foo ()
{
  union U u;

<bb 2>:
  <retval>.b = 1;
  use_bool (<retval>);
  u.i = 65534;
  <retval> = u;
  u ={v} {CLOBBER};
  return <retval>;

so SRA managed to remove the aggregate temporary and its copy.

So, I don't see what's wrong on PPC (with SRA, that is).  This must be
a target bug if at all (note I'm only inspecting dumps and did not
reproduce the execute fail).

Reply via email to