Patrice Mandin wrote:
Be careful with the frame pointer. On X86, for example, it is used to process exceptions in C++ programs. I don't know how it behaves in this case on m68k. Also, yesterday I add a problem with gcc 2.95 on m68k, and a program dealing with 64 bits integer. long long values where stored in the stack frame, link/unlk instructions where used, even if I add -fomit-frame-pointer.
When the frame pointer is required in a function, it is always used, regardless to the -fomit-frame-pointer option. A very simple trick for forcing the usage of the frame pointer in a function is to call the function alloca. For example, "alloca(1);" at the top.
So the -fomit-frame-pointer option is harmless (except when there is as compiler bug !).
The best thing you can do, is try to run gdb on a program compiled without the frame pointer.
Last time I did that, it was for that damn Quake bug, which appeared only when -fomit-frame-pointer was used ! Debugging is really horrible without the frame pointer.
Ok, that CAN_DEBUG_WITHOUT_FP feature is not a good thing, I will not enable it again in my next GCC patch.
Thanks for your advices. -- Vincent Rivière