This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/63537] [4.8/4.9/5 Regression] Missed optimization: Loop unrolling adds extra copy when returning aggregate
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Oct 2014 20:37:35 +0000
- Subject: [Bug tree-optimization/63537] [4.8/4.9/5 Regression] Missed optimization: Loop unrolling adds extra copy when returning aggregate
- Auto-submitted: auto-generated
- References: <bug-63537-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63537
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Eventually a simple pass could handle
>
> <retval> = ret;
> ret ={v} {CLOBBER};
> return <retval>;
>
> and back-propagate <retval> into all stores/loads of ret.
Shouldn't tree-nrv.c already handle this, except that it currently bails out if
TREE_ADDRESSABLE (found)? (strangely enough it has (dead) code to handle the
addressable case further in the same function)