avr-libc-dev
[Top][All Lists]
Advanced

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

RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block causehanginATm


From: Stu Bell
Subject: RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block causehanginATmega256x
Date: Wed, 9 Apr 2008 13:38:54 -0600

I'm not sure I should respond to this, as I'm not sure what the asm
directive ".rept 30000" does.  If I'm way off base, just email me
directly and I'll shut up.

The compiled code does show that, for an avr6, the function pointer code
is wrong (okay, not completely right).

-------------------------------------------
#define BIGCODE()       asm volatile (".rept 30000\n\tnop\n\t.endr")

void (* volatile vp) (void);

__attribute__((noinline)) void foo1 (void)  { BIGCODE(); vp = foo1; }

-------------------------------------------
.global foo1
        .type   foo1, @function
foo1:
/* prologue: function */
/* frame size = 0 */
/* #APP */
 ;  10 "test.c" 1
        .rept 30000
        nop
        .endr
 ;  0 "" 2
/* #NOAPP */
        ldi r24,lo8(gs(foo1))
        ldi r25,hi8(gs(foo1))
        sts (vp)+1,r25
        sts vp,r24
/* epilogue start */
        ret
-------------------------------------------

In particular, the generated code is loading a 2 byte PC to foo1().  On
avr6, it should be 3 bytes.


Best regards, 

Stu Bell 
DataPlay (DPHI, Inc.) 


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Weddington, Eric
Sent: Wednesday, April 09, 2008 8:40 AM
To: Dmitry K.; address@hidden
Subject: RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block
causehanginATmega256x

 

> -----Original Message-----
> From: 
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Weddington, Eric
> Sent: Wednesday, April 09, 2008 8:24 AM
> To: Dmitry K.; address@hidden
> Subject: RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block 
> causehangin ATmega256x
> 
>  
> 
> > -----Original Message-----
> > From: 
> > address@hidden
> > [mailto:address@hidden
> > org] On Behalf Of Dmitry K.
> > Sent: Wednesday, April 09, 2008 12:24 AM
> > To: address@hidden
> > Subject: Re: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block 
> > cause hangin ATmega256x
> > 
> > Hm...
> > 
> > Is avr-gcc for avr6 ready to use?
> > 
> > I have try avr-gcc 4.4-20080404 (4.3.0 does not support avr6) with 
> > binutils 2.18.
> 
> You need to try either 4.4 with Andy's combine.c patch committed (only
> recently) or 4.3 with his patch. See attached. 
> 
> I will try your test case later on today with Andy's patch.

See attached compiler output. So far it looks ok to me.

Eric




reply via email to

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