https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87811
Bug ID: 87811 Summary: [9 Regression] ICE with __builtin_expect_with_probability Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- void bar (void); void foo (int i, double d) { if (__builtin_expect_with_probability (i, 0, d)) bar (); } ICEs at -O2: internal compiler error: tree check: expected real_cst, have mult_expr in expr_expected_value_1, at predict.c:2471 in both C and C++. Either we need to early (+ in documentation) require that the last argument is a floating point constant (e.g. in builtins.c folding error on the last arg not being a REAL_CST), or we need to document what it means if the last argument is a variable, whether we ignore the hint altogether or what else we do.