This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
clobber
- From: Florent Defay <spira dot inhabitant at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 24 Jul 2009 14:24:47 +0200
- Subject: 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