While working on PR 111972, I was getting a regression
due to zero_one_valued_p matching a signed 1 bit integer
when it came to convert. This patch fixes that by checking
the outer type too.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* match.pd (zero_one_valued_p): For convert
make sure type is not a signed 1-bit integer.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
(if (INTEGRAL_TYPE_P (TREE_TYPE (@1))
&& (TYPE_UNSIGNED (TREE_TYPE (@1))
|| TYPE_PRECISION (TREE_TYPE (@1)) > 1)
+ && INTEGRAL_TYPE_P (type)
+ && (TYPE_UNSIGNED (type)
+ || TYPE_PRECISION (type) > 1)
&& wi::leu_p (tree_nonzero_bits (@1), 1))))
/* Transform { 0 or 1 } * { 0 or 1 } into { 0 or 1 } & { 0 or 1 }. */