[Top][All Lists]

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

Re: [avr-gcc-list] Strange behaviour in avr-gcc 3.3 with -O3

From: Klaus Rudolph
Subject: Re: [avr-gcc-list] Strange behaviour in avr-gcc 3.3 with -O3
Date: Fri, 23 Aug 2002 18:48:16 +0200

ken restivo wrote:
> Hash: SHA1
> Now, I'm probably on the bleeding edge here, but I needed gcc 3.3 (cvs) to 
> get avr-libc to compile from cvs. So if the answer is, "hey, what'd you 
> expect?", then, well, I guess I should expect that. ;-)
> Still, here's the problem.
> With -O2, everything is good.
> But with -O3, I get this (disassembled):
>        testmut = malloc(sizeof(*testmut));
>             ea:   85 e0           ldi r24, 0x05   ; 5
>             ec:   90 e0           ldi r25, 0x00   ; 0
>             ee:   17 d8           rcall   .-4050      ; 0xfffff11e
> That's a lotta ffff's! And malloc() is actually in the binary at
>                 0000111e <malloc>:

This seems not to be a bug, the program should run.

if you calc this your self:
opcode 0xd817 (rjmp->b000) -> Offset is 0x817
calculation for rjump is PC=Offset+1 in Words so
we get: (0x817+1) *2 = 0x1030

the jump comes from 0xee so you will get 0x111e
and hey that is what we want.

There is a bug in the disassembler, not in the compiler.

avr-gcc-list at http://avr1.org

reply via email to

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