------- Comment #7 from rguenth at gcc dot gnu dot org  2008-01-27 14:14 -------
One important structure copy propagation that SRA is not able to handle is

struct X { int i; int j; };

void foo(struct X);
inline void wrap(struct X w) { foo(w); }
void bar(struct X x) { wrap(x); }

where a copy from the parameter x in bar to the temporary used as parameter
to the call to foo remains (because both cannot be decomposed by SRA as
they need to live in memory):

bar (x)
{
  int x$j;
  int x$i;
  struct X w;

<bb 2>:
  x$i_8 = x.i;
  x$j_9 = x.j;
  w.j = x$j_9;
  w.i = x$i_8;
  foo (w) [tail call];
  return;

}

In this case expansion works anyway because the call to foo is marked as
tail-call before SRA comes along.

SRA heuristics also doesn't work very well here, as it is clearly not
profitable to do element-copy here; in fact it probably makes structure
copy-prop more difficult to implement.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|23782                       |
              nThis|                            |


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

Reply via email to