ÎâêØ wrote:
(define_insn "*shift_predicate_cmp"
[(set (const_int 0)
(and:BI (and:BI (match_operand:BI 1 "register_operand" "c")
(and:BI (match_operand:DI 2 "gr_reg_or_8bit_adjusted_operand" "rL")
(match_operand:DI 3 "gr_register_operand" "r")))
(match_operand:BI 0 "register_operand" "c")))]
""
"(%0) cmp.ne %1, p0 = %2, %3"
[(set_attr "itanium_class" "icmp")])
it warns "WAW" and there should be stop ";;" between these two
instructions.
It is the assembler that is giving the warning. The assembler knows
that the %1 operand is modified by the instruction, but the compiler
does not, because the %1 operand is not a SET_DEST operand. Your
SET_DEST is (const_int 0) which is useless info and incorrect. You need
to make sure that the RTL is an accurate description of what the
instruction does.
Besides the problem with the missing SET_DEST, there is also the problem
that you are using AND operands for a compare, which won't work. AND
and NE are not interchangeable operations. Consider what happens if you
compare 0x1 with 0x1. cmp.ne returns false. However, AND returns 0x1,
which when truncated from DImode to BImode is still 0x1, i.e. true. So
the RTL does not perform the same operation as the instruction you
emitted. This could confuse the optimizer.
GCC internals assume that predicate registers are always allocated in
pairs, and that the second one is always the inverse of the first one.
Defining a special pattern that only modifies one predicate register
probably isn't gaining you much. If you are doing this before register
allocation, then you are still using 2 predicate registers, as the
register allocator will always give you 2 even if you only use one.
Worst case, if this pattern is exposed to the optimizer, then the
optimizer may make changes that break your assumptions. It might
simplify a following instruction by using the second predicate reg for
instance, which then fails at run-time because you didn't actually set
the second predicate reg. If you are only using this in sequences that
the optimizer can't rewrite, then you should be OK.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com