This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/14295] [tree-ssa] copy propagation for aggregates
- 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: 27 Jan 2008 14:14:06 -0000
- Subject: [Bug tree-optimization/14295] [tree-ssa] copy propagation for aggregates
- References: <bug-14295-1008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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