(simplify
(bit_ior:c (lshift @0 INTEGER_CST@1)
(bit_xor (rshift @2 INTEGER_CST@3) INTEGER_CST@4))
- (if (tree_fits_uhwi_p (@1)
+ (if (type_has_mode_precision_p (type)
+ && tree_fits_uhwi_p (@1)
&& tree_fits_uhwi_p (@3)
&& tree_fits_uhwi_p (@4)
&& ((~((HOST_WIDE_INT_1U << tree_to_uhwi (@1)) - 1)) & tree_to_uhwi (@4)) == 0
(simplify
(bit_ior:c (bit_xor (lshift @0 INTEGER_CST@1) INTEGER_CST@2)
(rshift @3 INTEGER_CST@4))
- (if (tree_fits_uhwi_p (@1)
+ (if (type_has_mode_precision_p (type)
+ && tree_fits_uhwi_p (@1)
&& tree_fits_uhwi_p (@2)
&& tree_fits_uhwi_p (@4)
&& (((((HOST_WIDE_INT_1U << tree_to_uhwi (@1)) - 1)) & tree_to_uhwi (@2)) == 0)
--- /dev/null
+/* { dg-do compile { target bitint } } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+
+typedef unsigned _BitInt(4) B;
+
+B a, b;
+
+void
+foo()
+{
+ b *= (a ^ 2wbu) << 2 |
+ (a ^ 2wbu) >> 2;
+|