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]

error in finding a register to spill


Hi, there.

I had an error like follows which is similar as I'd had before.
Then I posted a message about it thought, still I don't solve it perfectly.

**********************************************************
../../gcc-3.4.0/gcc/libgcc2.c: In function `__fixunsdfsi':
../../gcc-3.4.0/gcc/libgcc2.c:1386: error: unable to find a register to spill in class `GR_REGS'
../../gcc-3.4.0/gcc/libgcc2.c:1386: error: this is the insn:
(insn 11 10 12 0 ../../gcc-3.4.0/gcc/libgcc2.c:1383 (set (reg:CC 39 $fcc0)
        (ge:CC (reg/v:DF 34 $f2 [orig:174 a ] [174])
            (reg:DF 32 $f0 [175]))) 149 {sge_df} (insn_list 3 (insn_list 10 (nil)))
    (expr_list:REG_DEAD (reg:DF 32 $f0 [175])
        (nil)))
../../gcc-3.4.0/gcc/libgcc2.c:1386: confused by earlier errors, bailing out
make[2]: *** [libgcc/./_fixunsdfsi.o] Error 1
**********************************************************

sge_df patter is as follows. z is a constraint for a status register.

**********************************************************
(define_insn "sge_df"
  [(set (match_operand:CC 0 "register_operand" "=z")
	(ge:CC (match_operand:DF 1 "register_operand" "f")
	       (match_operand:DF 2 "register_operand" "f")))]
  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
  "c.le.d\t%2,%1"
  [(set_attr "type" "fcmp")
   (set_attr "mode" "FPSW")])
**********************************************************

I have 32 general registers, 8 floating-point registers and 1 status register which is allocated to $f7.
It means there are 7 fp registers actually and 1 cc register.
I declare them as follows,

******************************************************
#define GP_REG_FIRST 0
#define GP_REG_LAST  31
#define GP_REG_NUM   (GP_REG_LAST - GP_REG_FIRST + 1)

#define FP_REG_FIRST 32
#define FP_REG_LAST  38
#define FP_REG_NUM   (FP_REG_LAST - FP_REG_FIRST + 1)

#define ST_REG_FIRST 39
#define ST_REG_LAST  39
#define ST_REG_NUM   (ST_REG_LAST - ST_REG_FIRST + 1)
******************************************************

I got a greg file by using -da option, but I can't see how to read it.

**********************************************************
;; Function __fixunsdfsi

;; 2 regs to allocate: 174 (2) 173
;; 173 conflicts: 173 28 29 31
;; 173 preferences: 2
;; 174 conflicts: 174 175 176 178 179 2 28 29 31 32 33 39
;; 175 conflicts: 174 175 28 29 31 32 33
;; 176 conflicts: 174 176 2 28 29 31
;; 178 conflicts: 174 178 28 29 31 32 33
;; 178 preferences: 39
;; 179 conflicts: 174 179 2 28 29 31
;; 180 conflicts: 180 28 29 31 32 33
;; 180 preferences: 39
;; 181 conflicts: 181 182 2 28 29 31 32
;; 181 preferences: 33 39
;; 182 conflicts: 181 182 2 28 29 31 32

Spilling for insn 11.
*********************************************************

Could you guess from above info what is going wrong?
I don't know why it says 'GR_REGS'.
And if I change "=z" to "" in sge_df pattern, it comes to work.
So it means there is something wrong about status registers, isn't it?
I hope your help.

Regards,
Shinpei


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