This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/11807] GCC should error out when clobbering the stack or frame pointer


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]