https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103419
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Component|target |middle-end Last reconfirmed| |2021-11-25 --- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> --- (match (nop_atomic_bit_test_and_p @0 @1 @4) (bit_and (convert?@4 (ATOMIC_FETCH_OR_XOR_N @2 INTEGER_CST@0 @3)) INTEGER_CST@1) (with { int ibit = tree_log2 (@0); int ibit2 = tree_log2 (@1); } (if (ibit == ibit2 && ibit >= 0 && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@2)))))) (match (nop_atomic_bit_test_and_p @0 @1 @3) (bit_and (convert?@3 (SYNC_FETCH_OR_XOR_N @2 INTEGER_CST@0)) INTEGER_CST@1) (with { int ibit = tree_log2 (@0); int ibit2 = tree_log2 (@1); } (if (ibit == ibit2 && ibit >= 0 && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@2)))))) (match (nop_atomic_bit_test_and_p @0 @0 @4) (bit_and:c (convert1?@4 (ATOMIC_FETCH_OR_XOR_N @2 (nop_convert? (lshift@0 integer_onep@5 @6)) @3)) (convert2? @0)) (if (TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@2))))) (match (nop_atomic_bit_test_and_p @0 @0 @4) (bit_and:c (convert1?@4 (SYNC_FETCH_OR_XOR_N @2 (nop_convert? (lshift@0 integer_onep@3 @5)))) (convert2? @0)) (if (TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@2))))) are wrong. Here "type" is an integer type. But TREE_TYPE (@2) is a pointer type. We should compare 2 integer types, not an integer type and a pointer types.