This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/11807] GCC should error out when clobbering the stack or frame pointer
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2003 08:54:44 -0000
- Subject: [Bug inline-asm/11807] GCC should error out when clobbering the stack or frame pointer
- References: <20030805124527.11807.aw11@os.inf.tu-dresden.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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