This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/50384] Returning std::array is not optimal


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));}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]