On Wed, Oct 31, 2018 at 11:04:32AM +0100, Martin Liška wrote: > Hi. > > As Jakub pointed out we should not ICE when last argument > of __builtin_expect_with_probability is not a real cst. > Plus I documented the behavior.
That is not what you've implemented. The documentation says that it must be a compile time constant, but nothing enforces it, just silently ignores it. So, either diagnose it at the time when __builtin_expect_with_probability is removed from the IL, i.e. the code you've touched? and expand_builtin_expect_with_probability and the argument would be really a late constant (constant after inlining and optimizations), or diagnose it in fold_builtin_expect and replace with the argument at that point. And, please diagnose also the cases where the probability is not >= 0.0 and <= 1.0. > * doc/extend.texi: Update constrain about the last arguemnt s/arguemnt/argument/ Jakub