edge edge_true_true, edge_true_false, edge_false;
gimple *g2 = NULL;
if (!single_comparison)
- g2 = gimple_build_cond (EQ_EXPR, idx,
+ g2 = gimple_build_cond (NE_EXPR, idx,
size_int (startlimb), NULL_TREE,
NULL_TREE);
if_then_if_then_else (g, g2, profile_probability::likely (),
- profile_probability::unlikely (),
+ profile_probability::likely (),
edge_true_true, edge_true_false,
edge_false);
unsigned tidx = startlimb + (cmp_code == GT_EXPR);
/* PR middle-end/112336 */
/* { dg-do compile { target bitint } } */
-/* { dg-options "-std=c2x" } */
+/* { dg-options "-std=c23" } */
unsigned _BitInt(1) v1;
unsigned _BitInt(1) *p1 = &v1;
/* PR c/111309 */
/* { dg-do run { target bitint } } */
-/* { dg-options "-std=c2x -pedantic-errors" } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
/* PR c/111309 */
/* { dg-do run { target bitint } } */
-/* { dg-options "-std=c2x -pedantic-errors" } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
--- /dev/null
+/* PR middle-end/112750 */
+/* { dg-do run { target bitint } } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __BITINT_MAXWIDTH__ >= 256
+_BitInt(256) a = __INT_MAX__ + (_BitInt(256)) 1;
+_BitInt(256) b = __INT_MAX__;
+#endif
+#if __BITINT_MAXWIDTH__ >= 512
+_BitInt(512) c = 0x7fffffffffffffffffffffffffffffffffffffffwb + (_BitInt(512)) 1;
+_BitInt(512) d = 0x7fffffffffffffffffffffffffffffffffffffffwb;
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 256
+ if (!__builtin_sub_overflow_p (a, 0, 0))
+ __builtin_abort ();
+ if (!__builtin_sub_overflow_p (b, -1, 0))
+ __builtin_abort ();
+#endif
+#if __BITINT_MAXWIDTH__ >= 512
+ if (!__builtin_sub_overflow_p (c, 0, (_BitInt(160)) 0))
+ __builtin_abort ();
+ if (!__builtin_sub_overflow_p (d, -1, 0))
+ __builtin_abort ();
+#endif
+ return 0;
+}