public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/11807] GCC should error out when clobbering the stack or frame pointer
Date: Fri, 21 Nov 2003 08:54:00 -0000	[thread overview]
Message-ID: <20031121085444.26936.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030805124527.11807.aw11@os.inf.tu-dresden.de>


------- Additional Comments From rth at gcc dot gnu dot org  2003-11-21 08:54 -------
(In reply to comment #9)
> Presumably if the programmer is intentionally, explicitly clobbering
> the frame pointer, the base pointer, or both using inline assembly,
> they are doing so knowing full well what they are doing

I would say this is demonstrably false.  Indeed, I would say exactly
the opposite.  If they knew what they were doing, they would realize
that clobbering the frame pointer will throw the compiler into a 
tizzy and WILL NEVER WORK.

The nature of GCC's inline assembly is unfortunate.  It's extremely
powerful, but it exposes so much of compiler internals that you have
to know how the compiler works so as to avoid invalid corner cases.

> The assertion that there is no useful application for such clobbering
> is false, as careful adjusting of the frame and base pointers in
> assembly interleaved with struct/array accesses in C can produce ...

... a mess.  Use out-of-line assembly if you're going to be playing
with such stack frame fundamentals.


-- 


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


  parent reply	other threads:[~2003-11-21  8:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 12:45 [Bug c++/11807] New: Wrong usage of registers on ARM 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
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 [this message]
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=20031121085444.26936.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).