This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50384] Returning std::array is not optimal
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jan 2012 20:17:20 +0000
- Subject: [Bug middle-end/50384] Returning std::array is not optimal
- Auto-submitted: auto-generated
- References: <bug-50384-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50384
--- Comment #3 from Marc Glisse <marc.glisse at normalesup dot org> 2012-01-28 20:17:20 UTC ---
(In reply to comment #2)
> The issue with comment #1 is simple, f is not being marked as a tail call.
Marking it as a tail call would indeed work for that case. In this slight
variation however, I get a similar long copying to move the return value to an
argument for the next call, where I would expect the compiler to just move the
64bit register that contains it.
#include <array>
typedef std::array<char,7> X;
void h(X);
X f(X,X);
void g(X a,X b){h(f(a,b));}