From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28479 invoked by alias); 25 Feb 2007 19:00:18 -0000 Received: (qmail 28428 invoked by uid 48); 25 Feb 2007 19:00:08 -0000 Date: Sun, 25 Feb 2007 19:00:00 -0000 Message-ID: <20070225190008.28427.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/19431] missed optimization with ifs and deferencing In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pluto at agmk dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-02/txt/msg02830.txt.bz2 ------- Comment #10 from pluto at agmk dot net 2007-02-25 19:00 ------- one more testcase: #include #include 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