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]

insn generator strange behaviour.


Fellows,
I am trying to implement inline SFmode compare as following.
I define cmpsf pattern as:

(define_expand "cmpsf"
  [(set (cc0)
        (compare:SF (match_operand:SF 0 "nonimmediate_operand_msp430" "rm")
                    (match_operand:SF 1 "general_operand_msp430" "rmi")))]
""
"{
	if(GET_CODE(operands[1]) == CONST_DOUBLE)
	{	... easy to implement and no tricks here ... }
	else {
               if(!register_operand(operands[0],SFmode))
                        operands[0] = copy_to_mode_reg(SFmode,operands[0]);
                if(!register_operand(operands[1],SFmode))
                        operands[1] = copy_to_mode_reg(SFmode,operands[1]);
                emit_insn(gen_cmpsf_call(operands[0],operands[1]));
                DONE;
	}
}")

(define_expand "cmpsf_call"
  [(set (reg:SF 14) (match_operand:SF 0 "register_operand" "r"))
   (set (reg:SF 12) (match_operand:SF 1 "register_operand" "r"))
   (set (cc0) (compare:SF (reg:SF 14) (reg:SF 12)))
        (clobber (reg:SF 14))
        (clobber (reg:SF 12))]
""
"")

(define_insn "*cmpsf_call"
   [(set (cc0) (compare:SF (reg:SF 14) (reg:SF 12)))
        (clobber (reg:SF 14))
        (clobber (reg:SF 12)))]
""
"call   #__cmpsf
        tst     r15"
[(set_attr "length" "3")
 (set_attr "cc" "compare")])
-----------------------------------------------------------------------------------------

So, the compiler crashes at equiv_constant() in cse.c.
If I comment clobbers, gcc works fine with no tricks at all.
But in this case I suppose gcc does not know that (reg:SF 14) (reg:SF 12) are 
clobbered. (but somehow anyway gcc makrs them REG_DEAD)

If I use 'parallel ...' it crashes eather...

Did I miss something?
Thanks in advance,
Dmitry.




-- 
/********************************************************************
     ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
      `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys 
      (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
    _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
   (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
 ********************************************************************/


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