Hello, Compiler is gcc version 4.4.1 (Sourcery G++ Lite 2010q1-188) Please consider this testcase (reduced from rockbox snake.c), at -O level a label is referenced but not present from the assembler % cat test.i static int head = 0; void _start (void) { char x, y; for (x = head; x < 2; x++) { y = x; switch (head) { case 0: y = 0; default: head = ++y; } } } % /usr/local/arm-2010q1/bin/arm-none-eabi-gcc -O test.i /tmp/ccGWjXRm.o: In function `_start': test.i:(.text+0x1c): undefined reference to `.L3' collect2: ld returned 1 exit status % /usr/local/arm-2010q1/bin/arm-none-eabi-gcc test.i % FSF gcc 4.4.4 arm-elf-eabi works fine. I'm pasting the assembler output below: .cpu arm7tdmi .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 1 .eabi_attribute 30, 1 .eabi_attribute 18, 4 .file "snake-small.i" .text .align 2 .global _start .type _start, %function _start: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldr r3, .L10 ldr r3, [r3, #0] mov r2, r3 cmp r3, #1 bxhi lr mov r1, #1 .L8: cmp r3, #0 bne .L3 .L4: mov r3, r1 add r2, r2, #1 cmp r2, #2 bne .L8 ldr r2, .L10 str r1, [r2, #0] bx lr .L11: .align 2 .L10: .word .LANCHOR0 .size _start, .-_start .bss .align 2 .set .LANCHOR0,. + 0 .type head, %object .size head, 4 head: .space 4 .ident "GCC: (Sourcery G++ Lite 2010q1-188) 4.4.1" -- ✍ Rafaël Carré ☺
Attachment:
signature.asc
Description: PGP signature