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]

Trouble understanding reload dump file format..


    Morning all,

  I'm not entirely familiar with the format and meaning of all the terms used
in the reload pass dump files, I was wondering if someone could comment on
whether this seems sane or not:


mul.c: In function `try_mulsi3':
mul.c:5: error: unable to find a register to spill in class `MPD_REG'
Reload 0: reload_in (SI) = (reg/v:SI 3 r3 [102])
	MPD_REG, RELOAD_FOR_INPUT (opnum = 1)
	reload_in_reg: (reg/v:SI 3 r3 [102])
Reload 1: GENERAL_REGS, RELOAD_FOR_INPUT_ADDRESS (opnum = 3), can't combine,
secondary_reload_p
Reload 2: MPD_REG, RELOAD_FOR_INPUT_ADDRESS (opnum = 3), can't combine,
secondary_reload_p
	secondary_in_reload = 1
	secondary_in_icode = reload_insi
Reload 3: reload_in (SI) = (scratch:SI)
	MPR_REG, RELOAD_FOR_INPUT (opnum = 3)
	reload_in_reg: (scratch:SI)
	secondary_in_reload = 2
mul.c:5: error: this is the insn:
(insn 12 4 19 0 0x0 (parallel [
            (set (reg:SI 67 s3_MPRL(r0) [104])
                (mult:SI (reg/v:SI 2 r2 [103])
                    (reg/v:SI 3 r3 [102])))
            (clobber (scratch:SI))
        ]) 51 {mulsi3} (insn_list 4 (insn_list 3 (nil)))
    (expr_list:REG_DEAD (reg/v:SI 2 r2 [103])
        (expr_list:REG_DEAD (reg/v:SI 3 r3 [102])
            (expr_list:REG_UNUSED (scratch:SI)
                (nil)))))
mul.c:5: confused by earlier errors, bailing out


  In particular, I really don't understand what a RELOAD_FOR_INPUT_ADDRESS
means when all the operands are regs, or why there should be three reloads for
the same operand when it's just a clobber scratch.  Is there something special
about how reload handles clobber and match_scratch?

  The insn pattern looks like:

(define_insn "mulsi3"
  [(set (match_operand:SI 0 "register_operand" "=d")
        (mult:SI (match_operand:SI 2 "register_operand" "r")
                 (match_operand:SI 1 "register_operand" "a")))
   (clobber (match_scratch:SI 3 "b"))]
  "TARGET_MUL_BLOCK"
  "sw  \\t%3,%2    ; CAUSE MULTIPLY"
  [(set_attr "type" "mul")
   (set_attr "length" "4")]
)

where the constraint letters 'a', 'b' and 'd' mean MPD_REG, MPR_REG and
MPRL_REG respectively, classes that contain just a single special purpose hard
reg each.

  If I replace the match_scratch with an explicit (reg:SI) using the hard reg
num of the MPR_REG, instead of trying to regclass preference gcc into picking
it as the scratch register, all those reloads disappear.

  I currently use secondary reloads to specify that a GENERAL_REG is required
to reload the specialised regs from memory.  I tried making the secondary
reload class functions return NO_REGS for a (scratch:MM) pattern, but that got
me a different kind of error:

mul.c: In function `try_mulsi3':
mul.c:5: error: unrecognizable insn:
(insn 28 4 12 0 0x0 (set (reg:SI 65 s1_MPR(r0))
        (scratch:SI)) -1 (nil)
    (nil))
mul.c:5: internal compiler error: in extract_insn, at recog.c:2175

...which is even more confusing.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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