avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Internal compiler error


From: David Gesswein
Subject: [avr-gcc-list] Internal compiler error
Date: Thu, 24 Mar 2005 21:28:28 -0500

Using latest winavr targeting atmega8.  

Works (but uses more instructions) if
   if (*ndx++)
is changed to
   if (*ndx)
...
   ndx++

Compiling: demo.c
avr-gcc -c -mmcu=atmega8 -I. -gdwarf-2 -DF_CPU=8000000UL  -O2 -funsigned-char -f
unsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ad
hlns=demo.lst  -std=gnu99 -MD -MP -MF .dep/demo.o.d demo.c -o demo.o
demo.c: In function `main':
demo.c:25: error: unrecognizable insn:
(insn 11 55 10 0 demo.c:19 (set (reg:QI 43)
        (mem:QI (reg/v:HI 4 r4 [ ndx ]) [0 S1 A8])) -1 (nil)
    (nil))
demo.c:25: internal compiler error: in extract_insn, at recog.c:2083
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make: *** [demo.o] Error 1

> avr-gcc -v
Reading specs from i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=m:/WinAVR --build=mingw32 --hos
t=mingw32 --target=avr --enable-languages=c,c++ --with-dwarf2
Thread model: single
gcc version 3.4.3


/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <address@hidden> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.        Joerg Wunsch
 * ----------------------------------------------------------------------------
 *
 */

#include <avr/io.h>

uint8_t data[65];
register uint8_t *ndx asm("r4");

int
main (void)
{
   if (*ndx++)
      PORTB |= _BV(PB0); 
   else
      PORTB &= ~_BV(PB0); 

    return (0);
}


demo.i

# 1 "demo.c"
# 1 "c:\\67\\test\\atmel//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "demo.c"
# 11 "demo.c"
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 
1 3
# 86 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 3
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/sfr_defs.h"
 1 3
# 123 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/sfr_defs.h"
 3
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/inttypes.h"
 1 3
# 36 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/inttypes.h"
 3
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 
1 3
# 65 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef signed char int8_t;




typedef unsigned char uint8_t;
# 104 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef int int16_t;




typedef unsigned int uint16_t;
# 120 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef long int32_t;




typedef unsigned long uint32_t;
# 136 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef long long int64_t;




typedef unsigned long long uint64_t;
# 155 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef int16_t intptr_t;




typedef uint16_t uintptr_t;
# 37 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/inttypes.h"
 2 3
# 124 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/sfr_defs.h"
 2 3
# 87 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 
2 3
# 202 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 3
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/iom8.h"
 1 3
# 203 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 
2 3
# 256 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 3
# 1 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/portpins.h"
 1 3
# 257 
"i:/programs/winavr/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/io.h" 
2 3
# 12 "demo.c" 2

uint8_t data[65];
register uint8_t *ndx asm("r4");

int
main (void)
{
   if (*ndx++)
      (*(volatile uint8_t *)((0x18) + 0x20)) |= (1 << (0));
   else
      (*(volatile uint8_t *)((0x18) + 0x20)) &= ~(1 << (0));

    return (0);
}




reply via email to

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