This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RTL checking failed for libg++


With the current CVS, on i586-pc-linux-gnu, compilation of Integer.cc
of libg++ failed with the message

Integer.cc: In function `void clearbit (Integer &, long int)':
Integer.cc:1717: RTL check: expected code `const_int', have `reg'
Integer.cc:1717: Internal compiler error in `make_field_assignment', at combine.c:7428

I've reduced Integer.cc to the fragment

struct IntRep                     
{
  unsigned short  len;           
  unsigned short  sz;            
  short           sgn;           
  unsigned short  s[1];          
};
struct Integer
{
  IntRep*         rep;
};
 
void clearbit(Integer& x, long b)
{
  if (b >= 0)
    {
      int bw = (unsigned long)b / (sizeof(short) * 8 ) ;
      int sw = (unsigned long)b % (sizeof(short) * 8 ) ;
      if (x.rep->len > bw)
	x.rep->s[bw] &= ~(1 << sw);
    }
}

The backtrace in gdb is

#0  fancy_abort (file=0x84bc955 "../../gcc/combine.c", line=7428, 
    function=0x84bd141 "make_field_assignment") at ../../gcc/rtl.c:1249
#1  0x80f5a45 in rtl_check_failed_code1 () at ../../gcc/rtl.c:1181
#2  0x8214bad in make_field_assignment (x=0x4011f990)
    at ../../gcc/combine.c:7428
#3  0x8204a5c in simplify_set (x=0x4011f990) at ../../gcc/combine.c:5101
#4  0x81fe8e9 in combine_simplify_rtx (x=0x4011f990, op0_mode=VOIDmode, 
    last=0, in_dest=0) at ../../gcc/combine.c:4374
#5  0x81f40d0 in subst (x=0x4011f990, from=0x4011f930, to=0x40126670, 
    in_dest=0, unique_copy=0) at ../../gcc/combine.c:3377
#6  0x81f3aa0 in subst (x=0x4011a6d0, from=0x4011f930, to=0x40126670, 
    in_dest=0, unique_copy=0) at ../../gcc/combine.c:3293
#7  0x81e78bc in try_combine (i3=0x40125080, i2=0x40125000, i1=0x0)
    at ../../gcc/combine.c:1880
#8  0x81e01c1 in combine_instructions (f=0x40124560, nregs=41)
    at ../../gcc/combine.c:619
#9  0x804d71b in rest_of_compilation (decl=0x40122500)
    at ../../gcc/toplev.c:3274
#10 0x83f9ba1 in finish_function (lineno=22, flags=0)
    at ../../../gcc/cp/decl.c:13923
#11 0x848f033 in expand_body (fn=0x40122500)
    at ../../../gcc/cp/semantics.c:2738
#12 0x844f6b2 in yyparse () at parse.y:656
#13 0x804bb2f in compile_file (name=0x4011a568 "a.ii")
    at ../../gcc/toplev.c:2379
#14 0x804fc4b in main (argc=4, argv=0xbffffa74) at ../../gcc/toplev.c:4794

Just before the crash, we have

(gdb) l
7423	  else if (GET_CODE (src) == AND && GET_CODE (XEXP (src, 0)) == SUBREG
7424		   && subreg_lowpart_p (XEXP (src, 0))
7425		   && (GET_MODE_SIZE (GET_MODE (XEXP (src, 0))) 
7426		       < GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (src, 0)))))
7427		   && GET_CODE (SUBREG_REG (XEXP (src, 0))) == ROTATE
7428		   && INTVAL (XEXP (SUBREG_REG (XEXP (src, 0)), 0)) == -2
7429		   && rtx_equal_for_field_assignment_p (dest, XEXP (src, 1)))
7430	    {
7431	      assign = make_extraction (VOIDmode, dest, 0,
7432					XEXP (SUBREG_REG (XEXP (src, 0)), 1),
(gdb) p debug_rtx(src)
(and:HI (subreg:HI (rotate:SI (reg:SI 36)
            (subreg:QI (reg:SI 28) 0)) 0)
    (reg:HI 39))
$7 = void
(gdb) p debug_rtx(x)

(set (reg:HI 40)
    (and:HI (subreg:HI (rotate:SI (reg:SI 36)
                (subreg:QI (reg:SI 28) 0)) 0)
        (reg:HI 39)))
$9 = void
(gdb) s

If you need further information, please let me know

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]