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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Weddington, Eric
Sent: Wednesday, April 09, 2008 8:40 AM
To: Dmitry K.; [email protected]
Subject: RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block
causehanginATmega256x
> -----Original Message-----
> From:
> [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> org] On Behalf Of Weddington, Eric
> Sent: Wednesday, April 09, 2008 8:24 AM
> To: Dmitry K.; [email protected]
> Subject: RE: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block
> causehangin ATmega256x
>
>
>
> > -----Original Message-----
> > From:
> > [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > org] On Behalf Of Dmitry K.
> > Sent: Wednesday, April 09, 2008 12:24 AM
> > To: [email protected]
> > 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
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev