mergeable_cast_p = true;
else if (TREE_CODE (TREE_TYPE (rhs1)) == BITINT_TYPE
&& bitint_precision_kind (TREE_TYPE (rhs1)) >= bitint_prec_large
- && INTEGRAL_TYPE_P (TREE_TYPE (lhs)))
+ && (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ || POINTER_TYPE_P (TREE_TYPE (lhs))))
{
final_cast_p = true;
if (TREE_CODE (rhs1) == SSA_NAME
be needed. */
gcc_assert (TYPE_PRECISION (lhs_type) <= 2 * limb_prec);
gimple *g;
- if (TREE_CODE (lhs_type) == BITINT_TYPE
- && bitint_precision_kind (lhs_type) == bitint_prec_middle)
+ if ((TREE_CODE (lhs_type) == BITINT_TYPE
+ && bitint_precision_kind (lhs_type) == bitint_prec_middle)
+ || POINTER_TYPE_P (lhs_type))
lhs_type = build_nonstandard_integer_type (TYPE_PRECISION (lhs_type),
TYPE_UNSIGNED (lhs_type));
m_data_cnt = 0;
--- /dev/null
+/* PR tree-optimization/113692 */
+/* { dg-do compile { target bitint } } */
+/* { dg-options "-O2 -std=c23" } */
+
+#if __BITINT_MAXWIDTH__ >= 135
+_BitInt(135) i;
+#else
+_BitInt(63) i;
+#endif
+
+void *
+foo (void)
+{
+ void *ret = 0;
+ if (i & 1)
+ ret = (void *) 1;
+ return ret;
+}