[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [bugs #4101] setjmp/longjmp destroy changes in global

From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [bugs #4101] setjmp/longjmp destroy changes in global registers
Date: Thu, 13 Jan 2005 23:00:19 +0100
User-agent: Mutt/

As Dmitry K. wrote:

> Final (I hope) fixing version of setjmp is available:
>    setjmp-20050110.tar.gz
> Download it from:
>    http://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=4101
> Test suite is expanded.

What is the expected result from the testsuite?  It bails out for me

-------- Preservation call-saved regs:  at90s2313 -O1

Simulating a at90s2313 device.

WARNING: file avrcore.c: line 1135: Device does not have PORTC.
*** Simulate: exit with non-zero code

The variables v1 through v8 in simulavr's core look completely
suspicious to me, and your remark:

/* foo1 do not use call-saved registers.  But compiler must insert
   such preservation due to presence of function setjmp.        */
void foo1 (void)
    if (setjmp(env))

doesn't really match the generated code in any way:

.global foo1
        .type   foo1, @function
/* prologue: frame size=0 */
/* prologue end (size=0) */
        ldi r24,lo8(env)
        ldi r25,hi8(env)
        rcall setjmp
        or r24,r25
        brne .L3
        rcall foo2
        ldi r24,lo8(37)
        ldi r25,hi8(37)
        rcall exit

This is with:

% avr-gcc -v
Reading specs from /usr/local/lib/gcc/avr/3.4.1/specs
Configured with: ./configure --target=avr --disable-nls --prefix=/usr/local 
Thread model: single
gcc version 3.4.1

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]