Previously some places that should have handled __builtin_expect_with_probability is missing, so in some case it acts differently than __builtin_expect.
For example it was not handled in constant folding, thus in the following program, the "if" condition should be constantly true and folded, but previously it was not handled and cause warning "control may reach end of non-void function" (while __builtin_expect does not):
__attribute__((noreturn)) extern void bar(); int foo(int x, int y) { if (y) { if (__builtin_expect_with_probability(1, 1, 1)) bar(); } else return 0; }
Now it's fixed.
Please also validate this by doing some sort of test in a constexpr function if possible. That way you can make sure the parameter is evaluated.