__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