This is the mail archive of the gcc@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]
Other format: [Raw text]

segmentation fault in building __floatdisf.o


hi,
   I'm having some problem during build up of libgcc2 in function
__floatdisf(build up of __floatdisf.o).Actually i'm modifying mips
backend.The error is

../../gcc-4.1.0/gcc/libgcc2.c: In function '__floatdisf':
../../gcc-4.1.0/gcc/libgcc2.c:1354: internal compiler error: Segmentation fault

I tried to debug the reason of crash and following are my findings

before crash following pattern is called

(define_expand "cmp<mode>"
 [(set (cc0)
       (compare:CC (match_operand:GPR 0 "register_operand")
                   (match_operand:GPR 1 "nonmemory_operand")))]
 ""
{
fprintf(stderr," cmp<mode> \n");
 branch_cmp[0] = operands[0];
 branch_cmp[1] = operands[1];
debug_rtx(branch_cmp[0]);
debug_rtx(branch_cmp[1]);
 DONE;
})

as u can see i've printed the operands which are as follows

operand[0]
------------------
(subreg:SI (reg:DI 30) 4)

operand[1]
-----------------
(subreg:SI (reg:DI 25 [ u.0 ]) 4)

after this i think it tries to mach some s bCOND pattern but in this
case it fails .

Is this my proposition correct?

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

In another working case where no error is being generated.Following is
the sequence of called patterns

(define_expand "cmp<mode>"
 [(set (cc0)
       (compare:CC (match_operand:GPR 0 "register_operand")
                   (match_operand:GPR 1 "nonmemory_operand")))]
 ""
{
fprintf(stderr," cmp<mode> \n");
 cmp_operands[0] = operands[0];
 cmp_operands[1] = operands[1];
debug_rtx(cmp_operands[0]);
debug_rtx(cmp_operands[1]);
 DONE;
})

here the operand are

operands[0]
-------------------
(subreg:SI (reg:DI 30) 0)


operands[1] ------------------- (subreg:SI (reg:DI 25 [ u.0 ]) 0)

Then the following pattern is matched

(define_expand "bltu"
 [(set (pc)
       (if_then_else (ltu (cc0) (const_int 0))
                     (label_ref (match_operand 0 ""))
                     (pc)))]
 ""
{
fprintf(stderr,"\n branch_fp 8 bltu\n");
})


So in first failed case it must match the above mentioned pattern but fails to do so.So the only difference seems to be that bytenum offset in subreg expression is different.In failed case it is 4 and in successful case it is 0.

Both directories seems  to be copy of each other.Then why operands are
defiierent in cmpsi patterns.There are no floating point registers.The
option passed to gcc is -msoft-float.

I've tried my best to track the problem but could not due my limited
knowledge.Would you please give me some hint to debug the problem .

thanks,
shahzad


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