[Bug tree-optimization/46507] std::tuple missed optimization

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 16 19:53:00 GMT 2010


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-11-16 19:27:48 UTC ---
Paolo, your example *does* show a significant difference:  the missed
optimisation is in std::get() and not tuple itself, as shown by 

#include <tuple>
#include <utility>

struct A
{
    virtual void f () const;
};

void arg_tuple_test (const std::pair<A,A> &t)
{
    std::get<0>(t).f ();
}

void arg_pair_test (const std::pair<A,A> &t)
{
    t.first.f ();
}

The second function jumps directly to A::f



More information about the Gcc-bugs mailing list