Compiling the following code with "gcc -march=i386 -O2" gives and ICE. -march=i686 doesn't have the same failure. gcc version 4.1.0 20050507 (experimental) 3.3 and 3.4 both compile the code OK. typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef union { uint8_t _b[8]; uint16_t _w[2]; } MMXReg; register MMXReg *env asm("ebp"); register long T0 asm("ebx"); register long T1 asm("esi"); register long T2 asm("edi"); void foo (int order) { MMXReg r; r._w[0] = env->_w[order]; *env = r; } -------------------- t2.c:16: error: unable to find a register to spill in class 'GENERAL_REGS' t2.c:16: error: this is the insn: (insn:HI 14 28 16 0 (set (strict_low_part (subreg:HI (reg/v:DI 59 [ r ]) 0)) (mem/s:HI (plus:SI (mult:SI (reg/v:SI 60 [ order ]) (const_int 2 [0x2])) (reg:SI 58 [ env.0 ])) [0 <variable>._w S2 A16])) 42 {*movstricthi_1} (insn_list:REG_DEP_TRUE 12 (insn_list:REG_DEP_TRUE 6 (insn_list:REG_DEP_TRUE 26 (nil)))) (expr_list:REG_DEAD (reg/v:SI 60 [ order ]) (nil))) t2.c:16: internal compiler error: in spill_failure, at reload1.c:1897
Why do people use global registers :(.
Annother testcase. This one fails at -O2 with gcc 4.1.0 20050507 and 4.0.1 20050430. This is a regression from 3.4. typedef unsigned long long uint64_t; register int *env asm ("ebp"); register long T0 asm ("ebx"); register long T1 asm ("esi"); register long T2 asm ("edi"); void foo(void); void bar (long physaddr, uint64_t v) { if (*env) { foo (); *(uint64_t *) (physaddr + *env) = v; } }
*** This bug has been marked as a duplicate of 16185 ***
Hmm, I think only the second example is a dup.
(In reply to comment #4) > Hmm, I think only the second example is a dup. well, it is very easy to construct pile of such testcases -- just try to compile anything with -ffixed-ebp -ffixed-ebx -ffixed-esi -ffixed-edi.