On Thu, 01 Aug 2002 10:45:45 -0400,
Jim Houston <[EMAIL PROTECTED]> wrote:
>Dave, My patch should not be needed with gcc 2.96. I have
>seen the oops in the kdba_setjmp when I had broken Makefiles.
>In particular if the CONFIG_FRAME_POINTER should be controlling
>the -fomit-frame-pointer option. If you are using -fomit-frame-pointer
>then CONFIG_FRAME_POINTER should not be defined.
<aol>Me too</aol>. But I am not going to change kdb to workaround
Makefile problems. This is one of the problems that kbuild 2.5 was
designed to fix, to prevent mixing code with inconsistent options in
the same kernel.
>We just started building kernels with gcc 3.1 from the
>RedHat 8.0 beta and thats where we started seeing the
>problem I described. I like the idea of the compiler
>getting rid of the frame pointer save for leaf functions
>so I hope we can solve this.
>
>Keith, I just tried my version of setjmp with an old
>egcs-2.91.66 and you are correct that it is broken. I will
>try to figure out when this was fixed. I wonder if
>its broken the same way in all the older compilers? I could
>do an explicit save of ebp and use it if __builtin_frame_address
>returns trash. Sigh.
You cannot tell if __builtin_frame_address returns trash, on older
compilers it just gives you ebp. Nor can you save ebp and use your
copy; with CONFIG_FRAME_POINTER=n, ebp is just another general rgister.
I think the best thing is to defeat the gcc leaf optimization just for
kdba_setjmp and kdba_longjmp. Adding these lines to both functions
should fool gcc 3.1 and keep the same frame structure as gcc 2.96.
/* Defeat gcc 3.1 leaf optimization and maintain frame structure */
if (!current)
panic("Never happen");
We know that current is always true but gcc does no,t so it will
generate the call to panic, forcing the jmp functions to be non-leaf.
Jim, please try that with the original jmp code and gcc 3.1.