__builtin_longjmp problem

Artem Alimarine aalimari@best.ms.philips.com
Wed Aug 25 04:19:00 GMT 1999


Hello,
I use gcc-2.95 on Cygwin for i960-unknown-coff. The exception handling
does not work. As far as I could find it is due to __builtin_setjmp/longjmp.
The following code hangs on VxWorks 5.1:
int jbuf[1024];
if(__builtin_setjmp(jbuf) == 0) {
     __builtin_longjmp(jbuf, 1);
} else {
     printf("jumped\n");
}
In the assembler I can see that the code for longjmp is wrong:
code generated for __bulitin_setjmp (seems OK for me):
    ldconst _jbuf,g4
    st fp,(g4)
    ldconst L17,g5
    st g5,4(g4)
    st sp,8(g4)
    mov 0,g4
 
code generated for __buitin_longjmp(seems wrong):
    ldconst _jbuf,g4
    flushreg
    mov 1,fp
    lda -64(fp),pfp
    ld (g4),g5
    st g5,-56(fp)
    ld 8(g4),g4
    st g4,-60(fp)
    ret
How do I fix this?
Is that possible to make compiler to generate calls to a  setjmp/longjmp
from the library for exception handling?
I've seen a macro DONT_USE_BUITIN_SETJMP in the source code. How
do I turn it on for buiding gcc?
Best regards
Artem
begin:vcard 
n:Alimarine;Artem
tel;home:(+31) 40-2440633
tel;work:(+31) 40-2763078
x-mozilla-html:TRUE
adr:;;;;;;
version:2.1
email;internet:aalimari@best.ms.philips.com
fn:Artem Alimarine
end:vcard



More information about the crossgcc mailing list