From: Ian Lance Taylor <iant@google.com>
To: Jeroen Demeyer <jdemeyer@cage.ugent.be>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Inline assembly constraints question
Date: Wed, 20 Aug 2008 19:31:00 -0000 [thread overview]
Message-ID: <m3pro3vk38.fsf@google.com> (raw)
In-Reply-To: <48AC1FC6.4060308@cage.ugent.be> (Jeroen Demeyer's message of "Wed\, 20 Aug 2008 15\:44\:38 +0200")
Jeroen Demeyer <jdemeyer@cage.ugent.be> writes:
> This is the full asm statement:
> asm("# number_t& number_t::operator>>=(unsigned char s)\n"
> " shrdl %6, %4, %3\n"
> " movl %3, %0\n"
> " movl %5, %2\n"
> " shrdl %6, %2, %1\n"
> " shrl %6, %2\n"
> : "=&rm" (n0), "=&r" (n1), "=&r" (n2)
> : "2" (n0), "1" (n1), "g" (n2), "cI" (s)
> );
>
> The code generated is the following:
> shrdl %cl, %esi, %eax
> movl %eax, -4384(%ebp)
> movl -4384(%ebp), %eax
> shrdl %cl, %eax, %esi
> shrl %cl, %eax
>
> As you can see, %0 and %5 both become -4384(%ebp).
> See attachment for the output from -dg.
Thanks for the details. Unfortunately, I am no wiser. As far as I
can tell, this should work correctly. Either you've found a bug, or
I'm missing something.
If you like, and you want to help others avoid this problem, please
file a bug report with the preprocessed source code and command line
at http://gcc.gnu.org/bugzilla/ . For more information about filing
bug reports see http://gcc.gnu.org/bugs.html .
If you just want to fix it for yourself change constraint 0 to "=&r"
or change constraint 5 to "r".
Ian
prev parent reply other threads:[~2008-08-20 14:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-18 10:34 Jeroen Demeyer
2008-08-19 16:59 ` Ian Lance Taylor
2008-08-20 13:47 ` Jeroen Demeyer
2008-08-20 19:31 ` Ian Lance Taylor [this message]
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=m3pro3vk38.fsf@google.com \
--to=iant@google.com \
--cc=gcc-help@gcc.gnu.org \
--cc=jdemeyer@cage.ugent.be \
/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).