[Bug rtl-optimization/17825] New: ICE in reg_bitfield_target_p

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 4 06:59:00 GMT 2004


register struct S *b asm ("rbp");
register unsigned int c asm ("rbx");
register unsigned int f asm ("r14");
extern int a;

void foo (int);

struct S
{
  unsigned int h[8];
};

void
bar (void)
{
  unsigned int j, k, l, m;

  j = (f & 0xffff) | ((b->h[2] & 0xffff) << 16);
  k = c & 0xffff;
  if (k == 0)
    {
      foo (0);
    }
  l = (j / k) & 0xffff;
  m = (j % k) & 0xffff;
  f = (f & 0xffff0000) | l;
  b->h[2] = (b->h[2] & 0xffff0000) | m;
}

on x86_64 causes ICE in reg_bitfield_target_p.
try_combine is called on i3:
(insn 33 32 35 2 (set (strict_low_part (subreg:HI (reg/v:SI 43 r14 [ f ]) 0))
        (subreg:HI (reg:SI 68) 0)) 56 {*movstricthi_1} (insn_list:REG_DEP_TRUE 30
(nil))
    (expr_list:REG_DEAD (reg:SI 68)
        (nil)))
and i2:
(insn 30 29 31 2 (parallel [
            (set (reg:SI 68)
                (and:SI (reg:SI 66)
                    (const_int 65535 [0xffff])))
            (clobber (reg:CC 17 flags))
        ]) 289 {*andsi_1} (insn_list:REG_DEP_TRUE 29 (nil))
    (expr_list:REG_DEAD (reg:SI 66)
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

but somewhere changes the pattern of i3 into invalid rtl:
(set (strict_low_part (reg:HI 43 r14 [ f ]))
    (subreg:HI (reg:SI 66) 0))

(note missing subreg in the strict_low_part operand).
Works just fine in 3.3, reproduced in 3.4.2 and on HEAD.

-- 
           Summary: ICE in reg_bitfield_target_p
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-redhat-linux


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



More information about the Gcc-bugs mailing list