[Top][All Lists]

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

RE: [avr-gcc-list] jump_to_null question

From: Eric Weddington
Subject: RE: [avr-gcc-list] jump_to_null question
Date: Fri, 06 Jul 2007 15:25:29 -0600

> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Jan Menzel
> Sent: Thursday, May 24, 2007 5:55 AM
> To: address@hidden
> Subject: [avr-gcc-list] jump_to_null question
> Hi all!
>       I'm currently working on a bootloader for Mega8 and 88
> and found a
> problem I do not yet understand. At the end of the bootloader
> the code
> has to jump to the main reset vector at address 0x0000. If I do the
> usual way
>       void (*jump_to_null)(void) = 0x0000;
> gcc 3.4.6 complies:
>       LDI     R30, 0x0102
>       LDI     R31, 0x0103
>       ICALL
> and everything works fine, as expected.
>       But if I try to be more specific and define
>       void (* const jump_to_main)(void) = 0x0000;
> gcc 3.4.6 complies
>       RCALL   PC-0x0009
> which unfortunately does not what I intended.
>       Could anyone please point me to my error in reasoning
> or lack of
> understanding? Many thanks!


I would recommend that you just stick with the first way of doing it, since
it generates the correct code. You're using GCC 3.4.6 so reporting a bug for
that version would be a waste of time since the latest version of GCC is
4.2.0 (or 4.1.2 for many of the distros). If you find that GCC generates the
same bad code for GCC 4.x, then file a bug report for that.


reply via email to

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