public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Thomas Pinski <pinskia@gmail.com>
To: "gcc-bugzilla@gcc.gnu.org" <gcc-bugzilla@gcc.gnu.org>
Cc: "gcc-bugs@gcc.gnu.org" <gcc-bugs@gcc.gnu.org>
Subject: Re: [Bug c/39403] Excessive optimization issue
Date: Mon, 09 Mar 2009 15:57:00 -0000	[thread overview]
Message-ID: <4D7EC7E4-2908-469D-ABFE-9398E8EB344A@gmail.com> (raw)
In-Reply-To: <20090309153629.15991.qmail@sourceware.org>



Sent from my iPhone

On Mar 9, 2009, at 8:36 AM, "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.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
>


  reply	other threads:[~2009-03-09 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  4:06 [Bug c/39403] New: " casmyu at gmail dot com
2009-03-09 15:36 ` [Bug c/39403] " rguenth at gcc dot gnu dot org
2009-03-09 15:57   ` Andrew Thomas Pinski [this message]
2009-03-09 15:57 ` pinskia at gmail dot com
2009-03-10  1:23 ` casmyu at gmail dot com
2009-04-16 20:32 ` [Bug target/39403] " pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D7EC7E4-2908-469D-ABFE-9398E8EB344A@gmail.com \
    --to=pinskia@gmail.com \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-bugzilla@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).