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

-- 
           Summary: nternal compiler error: in spill_failure, at
                    reload1.c:1897
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pbrook at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


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

Reply via email to