The code snippet used to be part of an MD5 transform function
but I have stripped it down to the point where it is still valid C
code but does not do anything useful any more. In this state removing
any of the remaining lines usually prevents the ICE from occurring,
most notably the LPM macro (taken from avr-libc HEAD).
Shall I file this with bugzilla? And more importantly, what's causing
it and how can I fix this?
Cheers,
Stephan
The code snippet below yields the following ICE:
$ avr-gcc -Os -mmcu=atmega162 -c test.c
test.c: In function 'test':
test.c:46: error: unable to find a register to spill in class 'POINTER_REGS'
test.c:46: error: this is the insn:
(insn 18 115 20 0 (set (reg/v:SI 56 [ a ])
(mem:SI (post_inc:HI (reg/f:HI 22 r22 [orig:59 D.1226 ] [59])) [2 S4
A8])) 14 {*movsi} (insn_list:REG_DEP_TRUE 115 (nil))
(expr_list:REG_INC (reg/f:HI 22 r22 [orig:59 D.1226 ] [59])
(nil)))
test.c:46: internal compiler error: in spill_failure, at reload1.c:1897
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Compiler version:
$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../configure --target=avr --prefix=/home/eisvogel/avr
--enable-languages=c,c++ --disable-nls
Thread model: single
gcc version 4.1.0 20050422 (experimental)
--- TEST CASE START ---
#define __LPM_enhanced__(addr) \
({ \
unsigned int __addr16 = (unsigned int)(addr); \
unsigned char __result; \
__asm__ \
( \
"lpm %0, Z" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
); \
__result; \
})
void test ( unsigned long *state )
{
unsigned long a, b, c, d, temp;
unsigned char i;
a = state[0];
b = state[1];
c = state[2];
d = state[3];
for ( i=0 ; i<2 ; i++ ) {
temp = a;
switch ( i ) {
case 1: temp += (((b) & (d)) | ((c) & (~d)));
}
temp += __LPM_enhanced__( 0 );
a = d;
d = c;
c = b;
b = temp;
}
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
}
--- TEST CASE END ---
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list