https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121666
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2025-08-25
Status|UNCONFIRMED |NEW
Keywords| |accepts-invalid
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect_005fwith_005fprobability
"The probability argument must be a constant floating-point expression."
GCC does it reject it some of the time:
```
double rand_impl();
void h();
void foo (int i){
if (__builtin_expect_with_probability (i, 0, rand_impl()))
return;
h();
}
```
At -O1+ .