http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55181
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |olegendo at gcc dot gnu.org
--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #6)
> Note that a bit-test instruction can only be used if the and only feeds a
> comparison against zero. Not sure how canonical bit-test patterns should
> look like, but combine should be able to work this out, no? Unless we
> mess things up earlier during generic expansion (which seems to be the
> case)
A single bit test pattern such as (taken from SH)
(define_insn "tstsi_t"
[(set (reg:SI T_REG)
(eq:SI (and:SI (match_operand:SI 0 "logical_operand" "%z,r")
(match_operand:SI 1 "logical_operand" "K08,r"))
(const_int 0)))]
is not enough. If the second operand is a constant combine will try out
various variations (canonicalized bit extractions) such as zero_extend or
[(set (reg:SI T_REG)
(and:SI (not:SI (match_operand:SI 0 "logical_operand" "z"))
(const_int 1)))]