https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84799

            Bug ID: 84799
           Summary: ICE on valid code at -O1: in lra_split_hard_reg_for,
                    at lra-assigns.c:1802
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

It appears to be recent regression.

$ gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.1 20180309 (experimental) [trunk revision 258399] (GCC) 
$ 
$ gcctk -O0 small.c
$ gcc-7.2.0 -O1 small.c
$ 
$ gcctk -O1 small.c
small.c: In function ‘main’:
small.c:26:1: error: unable to find a register to spill
 }
 ^
small.c:26:1: error: this is the insn:
(insn 32 113 108 3 (parallel [
            (set (reg:DI 184 [149])
                (div:DI (reg:DI 184 [149])
                    (reg:DI 185)))
            (set (reg:DI 192 [148])
                (mod:DI (reg:DI 184 [149])
                    (reg:DI 185)))
            (clobber (reg:CC 17 flags))
        ]) "small.c":10 373 {*divmoddi4}
     (expr_list:REG_UNUSED (reg:DI 184 [149])
        (expr_list:REG_DEAD (reg:DI 185)
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
during RTL pass: reload
small.c:26:1: internal compiler error: in lra_split_hard_reg_for, at
lra-assigns.c:1802
0x5f15ae _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-source-trunk/gcc/rtl-error.c:108
0xb0d849 lra_split_hard_reg_for()
        ../../gcc-source-trunk/gcc/lra-assigns.c:1802
0xb07f57 lra(_IO_FILE*)
        ../../gcc-source-trunk/gcc/lra.c:2507
0xabb899 do_reload
        ../../gcc-source-trunk/gcc/ira.c:5465
0xabb899 execute
        ../../gcc-source-trunk/gcc/ira.c:5649
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ 


---------------------------------------------------------


int a, g;
long b, f;
short c, d, e;

static void fn1 ()
{
  if (a)
    {
      long i = 5, j = b / i | c;
      int k = b % (d % i) & j;
      short l = ~f % (-d / j ^ -e), m = e << (d - l);
      if (k)
        m = d;
      i = d | (i & b);
      g = (c | ~f) % i + l;
      e = (c - f) & e;
      d = m;
    }
}

int main ()
{
  b |= 1;
  fn1 ();
  return 0; 
}

Reply via email to