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]

unrecognizable insn after adding clobbers


Hi,

I have for call_value a define_expand and define_insn that look like:
(define_expand "call_value"
 [
    (set (match_operand 0 "" "")
         (call (match_operand:QI 1 "nonmemory_operand" "")
               (match_operand:QI 2 "immediate_operand" "")))
 ]
 ""
 "")

(define_insn "*call_value"
  [
    (set (match_operand 0 "" "")
         (call (mem:QI (match_operand:HI 1 "callable_operand" "yY,i"))
               (match_operand:QI 2 "immediate_operand" "i,i")))
  ]
  ""
{
    // CODE GEN deals with op0, 1 and 2.
})

This works, however I added a runtime option X which requires a more
complex generation of instructions, and requires 2 scratch registers
so I changed this define_insn into 2:
(define_insn "*call_value"
  [
    (set (match_operand 0 "" "")
         (call (mem:QI (match_operand:HI 1 "callable_operand" "yY,i"))
               (match_operand:QI 2 "immediate_operand" "i,i")))
  ]
  "!TARGET_X"
{
  return target_call(operands); // deals with op0, 1 and 2.
})

(define_insn "*call_value_complex"
  [
    (set (match_operand 0 "" "")
         (call (mem:QI (match_operand:HI 1 "callable_operand" "yY,i"))
               (match_operand:QI 2 "immediate_operand" "i,i")))
    (clobber (match_scratch:QI 3 "y,y"))
    (clobber (match_scratch:QI 4 "y,y"))
  ]
  "TARGET_X"
{
    return target_complex_call(operands); // deals with op0, 1, 2, 3, and 4.
})

This however causes an unrecognizable insn error during the compiler
runtime when I have TARGET_X defined.
I was expecting the clobbers not to influence the recognition but it
seems I was wrong.
What's the best way to solve this?

-- 
PMatos


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