This is the mail archive of the gcc-help@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]

clobber


Hello,

I am working on a new port. I have a problem with "clobber".

Here is a pattern used for shifting left. The function
target_emit_shift directly outputs asm instructions.
In this insn, operand 2 is used as a counter down to 0. Then after
this insn operand 2's value is zero. So operand 2 is clobbered.
That's why I use "clobber".

(define_insn "*ashlsi3_2"
  [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m")
                   (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
                              (match_operand:HI 2 "register_operand" "r,r")))
              (clobber (match_dup 2))])]
  ""
  {
    return target_emit_shift(ASHLSI, operands);
  })

But it has no effect on GCC and operand 2 is used later just as if it
was not clobbered. I think I do not use "clobber" properly.
I did not find another way to do this. Please, could you tell me how
to use "clobber" properly in this situation?

Regards.

Florent


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