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

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

[avr-gcc-list] avr-gcc bug 18251 not resolved (ice-on-valid-code)


From: Stephan Eisvogel
Subject: [avr-gcc-list] avr-gcc bug 18251 not resolved (ice-on-valid-code)
Date: Fri, 22 Apr 2005 17:17:03 +0200

Greetings,

Bug 18251 as discussed in

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

is  afaict  not fully resolved in gcc HEAD as of today. It compiles on
3.4.3 with no problems so this appears to be a 4.x regression.

I  have  not filed a bug report with gcc bugzilla as I have never done
this  and  I don't want to bug the developers with stupid errors on my
part.  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 ---






reply via email to

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