Bug 21469 - nternal compiler error: in spill_failure, at reload1.c:1897
Summary: nternal compiler error: in spill_failure, at reload1.c:1897
Status: RESOLVED DUPLICATE of bug 16185
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-05-09 14:43 UTC by Paul Brook
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i386-pc-linux-gnu
Target: i386-pc-linux-gnu
Build: i386-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Brook 2005-05-09 14:43:41 UTC
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
Comment 1 Andrew Pinski 2005-05-09 14:51:53 UTC
Why do people use global registers :(.
Comment 2 Paul Brook 2005-05-09 20:04:30 UTC
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;
    }
}
Comment 3 Serge Belyshev 2005-05-09 20:28:01 UTC

*** This bug has been marked as a duplicate of 16185 ***
Comment 4 Andrew Pinski 2005-05-09 20:30:56 UTC
Hmm, I think only the second example is a dup.
Comment 5 Serge Belyshev 2005-05-09 20:54:41 UTC
(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.