From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16023 invoked by alias); 9 Mar 2009 15:36:40 -0000 Received: (qmail 15992 invoked by uid 48); 9 Mar 2009 15:36:29 -0000 Date: Mon, 09 Mar 2009 15:36:00 -0000 Message-ID: <20090309153629.15991.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/39403] Excessive optimization issue In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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: 2009-03/txt/msg00618.txt.bz2 ------- Comment #1 from rguenth at gcc dot gnu dot org 2009-03-09 15:36 ------- You need to specify that the registers are clobbered by the asm. The only way to do that is to use output constraints ("+D", "+c", etc.) on proper temporaries. int lent = len; char *dstt = dst; char *srct = src; __asm__ __volatile__( "cld\n\t" "rep movsb" : "+c" (lent), "+D"(dstt), "+S"(src) ); Otherwise GCC thinks the registers still hold the original value. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39403