public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rearnsha at arm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/11807] Wrong usage of registers on ARM
Date: Tue, 05 Aug 2003 17:51:00 -0000	[thread overview]
Message-ID: <20030805175107.27391.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030805124527.11807.aw11@os.inf.tu-dresden.de>

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From rearnsha at arm dot com  2003-08-05 17:51 -------
Subject: Re:  Wrong usage of registers on ARM 

> I'm not using fp explicitely in my code, as you can see in test.ii. I just
> preserve it across system calls. The compiler uses fp to store non-pointer
> values in fp and later uses it as pointer!
> 
> So it is seemingly a BUG.

No, this asm statement clobbers fp (or appears to):

extern __inline__ l4_threadid_t l4_myself(void)
{
    l4_threadid_t id;

    asm volatile
      (
             " stmdb sp!, {fp} \n"
       "	mov	r0, %2					\n"
       "	mov	lr, pc					\n"
       "	mov	pc, %1					\n"
       "	mov	%0, r1					\n"
             " ldmia sp!, {fp} \n"
       :"=r" (id)
       :"i" ((-0x00000008-8)),
       "i" (((l4_threadid_t) { raw : 0 }).raw)
       :"r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
       "r10", "r11", "r12", "r14", "memory");

    return id;
}

This *will* confuse the compiler.

R.


  parent reply	other threads:[~2003-08-05 17:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 12:45 [Bug c++/11807] New: " aw11 at os dot inf dot tu-dresden dot de
2003-08-05 13:22 ` [Bug c++/11807] " pinskia at physics dot uc dot edu
2003-08-05 14:34 ` aw11 at os dot inf dot tu-dresden dot de
2003-08-05 17:51   ` Richard Earnshaw
2003-08-05 17:51 ` rearnsha at arm dot com [this message]
2003-08-05 18:14 ` falk at debian dot org
2003-08-06  3:40 ` [Bug c++/11807] GCC should error out when clobering the stack pointer or frame pointer pinskia at physics dot uc dot edu
2003-08-09 16:45 ` [Bug inline-asm/11807] " pinskia at gcc dot gnu dot org
2003-08-23  0:00 ` dhazeghi at yahoo dot com
2003-11-16 23:04 ` pinskia at gcc dot gnu dot org
2003-11-17 11:49 ` falk at debian dot org
2003-11-17 12:39 ` bmills at andrew dot cmu dot edu
2003-11-17 12:44 ` bmills at andrew dot cmu dot edu
2003-11-17 13:21 ` [Bug inline-asm/11807] GCC should error out when clobbering the stack " ebotcazou at gcc dot gnu dot org
2003-11-21  8:47 ` rth at gcc dot gnu dot org
2003-11-21  8:54 ` rth at gcc dot gnu dot org
2003-11-21  9:56 ` bmills at andrew dot cmu dot edu
2003-11-22 17:55 ` falk at debian dot org
2003-12-06 20:09 ` [Bug inline-asm/11807] GCC should error out when clobbering the stack pointer pinskia at gcc dot gnu dot org
2005-08-10 10:46 ` [Bug inline-asm/11807] GCC should error out when clobbering the stack pointer and frame pointer pinskia at gcc dot gnu dot org
2005-08-10 10:47 ` pinskia at gcc dot gnu dot org
2005-08-10 11:25 ` giovannibajo at libero dot it
2005-08-10 11:29 ` pinskia at gcc dot gnu dot org
2005-08-23 11:31 ` nigel at suspend2 dot net
2005-08-23 11:41 ` pinskia at gcc dot gnu dot org
2005-08-23 11:42 ` ncunningham at cyclades dot com
2005-08-26  9:34 ` aw11 at os dot inf dot tu-dresden dot de

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=20030805175107.27391.qmail@sources.redhat.com \
    --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).