------- Comment #10 from pluto at agmk dot net 2007-02-25 19:00 ------- one more testcase:
#include <tr1/functional> #include <algorithm> extern void assign( long* variable, long v ) { std::transform( variable, variable + 1, variable, std::tr1::bind( std::plus< long >(), 0L, v ) ); } extern void assign( long& variable, long v ) { std::transform( &variable, &variable + 1, &variable, std::tr1::bind( std::plus< long >(), 0L, v ) ); } at -O3 gcc 4.2 produces: assign(long&, long): movq -40(%rsp), %rax movq %rsi, -24(%rsp) movq $0, -32(%rsp) movq $0, -64(%rsp) movq %rsi, -56(%rsp) movq %rsi, (%rdi) movq %rax, -72(%rsp) ret assign(long*, long): movq %rsi, (%rdi) ret -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19431