public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rearnsha at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/31693] Incorrectly assigned registers to operands for ARM inline asm
Date: Tue, 10 Feb 2009 14:36:00 -0000	[thread overview]
Message-ID: <20090210143621.6207.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31693-14457@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from rearnsha at gcc dot gnu dot org  2009-02-10 14:36 -------
This is not a bug, but a problem with your source code.

In order to understand why, you need to pre-process the code and look at the
output:

...
void *memset_arm9(void *a, int b, int c)
{
  return ({ uint8_t *dst = ((uint8_t *)a); uint8_t c = (b); int count = (c);
uin
t32_t dummy0, dummy1, dummy2; __asm__ __volatile__ (

Notice that first there is a declaration of a variable c (uint8_t), then in the
next statement there is a use of c.  This use (which is intended to be of the
formal parameter passed to memset_arm9 is instead interpreted as the newly
declared variable c (the uint8 one).


Compiling your testcase with -Wshadow gives:

inl.c: In function 'memset_arm9':
inl.c:66: warning: declaration of 'c' shadows a parameter
inl.c:64: warning: shadowed declaration is here


-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31693


  parent reply	other threads:[~2009-02-10 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-25  6:24 [Bug inline-asm/31693] New: " siarhei dot siamashka at gmail dot com
2007-04-25  6:26 ` [Bug inline-asm/31693] " siarhei dot siamashka at gmail dot com
2007-04-25  6:28 ` siarhei dot siamashka at gmail dot com
2007-05-31 20:01 ` mikpe at it dot uu dot se
2008-05-13 12:33 ` siarhei dot siamashka at gmail dot com
2008-09-03  9:54 ` siarhei dot siamashka at gmail dot com
2009-02-10 14:36 ` rearnsha at gcc dot gnu dot org [this message]
2009-02-10 15:12 ` siarhei dot siamashka at gmail dot com
2009-02-10 15:21 ` rearnsha 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=20090210143621.6207.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).