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

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

Re: [avr-gcc-list] reproducable gcc error: unrecognizable insn


From: E. Weddington
Subject: Re: [avr-gcc-list] reproducable gcc error: unrecognizable insn
Date: Mon, 09 Sep 2002 09:56:44 -0600

On 6 Sep 2002 at 12:07, Oliver Kasten wrote:

> i get the following reproducable error:
> 
> avr-gcc -mmcu=atmega128 -O6 -Wall -c insn.c 
> insn.c: In function `foo':
> insn.c:18: unrecognizable insn:
> (insn 11 9 13 (set (reg:QI 42)
>         (const_int 129 [0x81])) -1 (nil)
>     (expr_list:REG_EQUAL (const_int 129 [0x81])
>         (nil)))
> insn.c:18: Internal compiler error in extract_insn, at recog.c:2148
> 
> when compiling the following piece of code with optimizations on
> (without optimization it compiles just fine).
> 
> --- snip ---
> 
> #include <string.h>
> 
> void foo();
> 
> typedef struct {
>   unsigned char a;
>   void* b;
> } array_el_t;
> 
> static array_el_t array[43];
> 
> void foo() {
>   memset( array, 0, sizeof(array) );
> }
> --- snip ---
> 
> the problem is memset(). curiously, when reducing the array to 42 (or
> less) elements, it works fine.
> 

I was able to reproduce the error. Interestingly though, if you 
rewrite:

void foo()
{
        size_t size;
        size = sizeof(array);
        memset(array,0,size);
}

This works for array element size > 42. 

Also note that (correct me if I'm wrong) the structure size is 3 
bytes. A 42 element array will then be size 126 bytes. A 43 element 
array will then be 129. It sounds like an overflow issue with a 
signed char. But I could be wrong.

The best thing to do is to post a bug report with gcc itself.

Eric
avr-gcc-list at http://avr1.org



reply via email to

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