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

           Summary: unable to find a register to spill in class ‘DIREG’
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ra
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ubiz...@gmail.com
                CC: pb...@csse.unimelb.edu.au
            Target: i686-pc-linux-gnu


Following testcase (minimized from PR47725):

--quote--
This is a test case generated by the Mercury compiler, it has been reduced just
enough code to cause the bug to occur.  It can be reproduced in gcc 4.4 and 4.6
at an optimization level of -O1 but not -O0.  The output of GCC is:
--/qoute--

--cut here--
register unsigned int MR_mr0 __asm__ ("esi");
register unsigned int MR_mr1 __asm__ ("edi");

void ml_backend__ml_closure_gen_module11 (void)
{
  unsigned int MR_tempr1, MR_tempr2, MR_tempr3;

  MR_tempr1 = (char *) malloc (sizeof (unsigned int)) + 4;

  MR_tempr3 = ((unsigned int *) MR_mr0)[0];
  ((unsigned int *) (MR_tempr1 - 4))[0] = MR_tempr3;

  MR_tempr2 = (char *) malloc (2 * sizeof (unsigned int));
  ((unsigned int *) MR_tempr2)[1] = MR_tempr1;
}
--cut here--

Compiled with -O1 -m32:

_.c: In function ‘ml_backend__ml_closure_gen_module11’:
_.c:15:1: error: unable to find a register to spill in class ‘DIREG’
_.c:15:1: error: this is the insn:
(insn 12 11 13 2 (parallel [
            (set (mem:SI (reg/f:SI 71) [0 *D.2004_8+0 S4 A32])
                (reg/v:SI 0 ax [orig:64 MR_tempr3 ] [64]))
            (set (reg/v:SI 61 [ MR_tempr1 ])
                (plus:SI (reg/f:SI 71)
                    (const_int 4 [0x4])))
        ]) ttt.c:11 860 {*strsetsi_1}
     (expr_list:REG_DEAD (reg/f:SI 71)
        (expr_list:REG_DEAD (reg/v:SI 0 ax [orig:64 MR_tempr3 ] [64])
            (nil))))
_.c:15:1: internal compiler error: in spill_failure, at reload1.c:2120
Please submit a full bug report,
...

Reply via email to