This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11520] New: code generator bug for avr mega8


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11520

           Summary: code generator bug for avr mega8
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rod at cs dot mun dot ca
                CC: gcc-bugs at gcc dot gnu dot org

version:

avr-gcc -v
Reading specs from /opt/avr-20030707/lib/gcc-lib/avr/3.3.1/specs
Configured with: ../configure --target=avr --enable-languages=c
--prefix=/opt/avr-20030707
Thread model: single
gcc version 3.3.1 20030707 (prerelease)


------------- bug.c -------------------
typedef void (*Jmp)(void);

int main( int ac, char *av[] )
{
    Jmp jmp = 0;

    (*jmp)();  /* jump to reset vector */

    return 0;
}

------------ bug.s ---------------------
global main
        .type   main, @function
main:
/* prologue: frame size=0 */
        ldi r28,lo8(__stack - 0)
        ldi r29,hi8(__stack - 0)
        out __SP_H__,r29
        out __SP_L__,r28
/* prologue end (size=4) */
        rcall 0                          <-- relative address ???
        ldi r24,lo8(0)
        ldi r25,hi8(0)
/* epilogue: frame size=0 */
        rjmp exit
/* epilogue end (size=1) */
/* function main size 8 (3) */
        .size   main, .-main
----------------------------------------------------------------
avr-objdump -D a.out yeilds

bug.o:     file format elf32-avr

Disassembly of section .text:

0000005c <main>:
  5c:   cf e5           ldi     r28, 0x5F       ; 95
  5e:   d4 e0           ldi     r29, 0x04       ; 4
  60:   de bf           out     0x3e, r29       ; 62
  62:   cd bf           out     0x3d, r28       ; 61
  64:   fb df           rcall   .-10            ; 0x5c <-- not address 0
  66:   80 e0           ldi     r24, 0x00       ; 0
  68:   90 e0           ldi     r25, 0x00       ; 0
  6a:   00 c0           rjmp    .+0             ; 0x6c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]