From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32364 invoked by alias); 9 Mar 2009 15:57:40 -0000 Received: (qmail 32346 invoked by uid 22791); 9 Mar 2009 15:57:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.244) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Mar 2009 15:57:34 +0000 Received: by rv-out-0708.google.com with SMTP id c5so2003298rvf.56 for ; Mon, 09 Mar 2009 08:57:32 -0700 (PDT) Received: by 10.141.195.9 with SMTP id x9mr3130568rvp.216.1236614252309; Mon, 09 Mar 2009 08:57:32 -0700 (PDT) Received: from ?10.81.0.21? ([32.152.86.135]) by mx.google.com with ESMTPS id b8sm14876872rvf.8.2009.03.09.08.57.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Mar 2009 08:57:31 -0700 (PDT) References: <20090309153629.15991.qmail@sourceware.org> Message-Id: <4D7EC7E4-2908-469D-ABFE-9398E8EB344A@gmail.com> From: Andrew Thomas Pinski To: "gcc-bugzilla@gcc.gnu.org" In-Reply-To: <20090309153629.15991.qmail@sourceware.org> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPhone Mail 5H11) Subject: Re: [Bug c/39403] Excessive optimization issue Date: Mon, 09 Mar 2009 15:57:00 -0000 Cc: "gcc-bugs@gcc.gnu.org" X-IsSubscribed: yes 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/msg00621.txt.bz2 Sent from my iPhone On Mar 9, 2009, at 8:36 AM, "rguenth at gcc dot gnu dot org" wrote: > > > ------- 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. Oh and mark this inline-ask as clobbering memory. > > > > -- > > 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 >