diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 270180f7e04..145195c21bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Martin Liska + + * doc/extend.texi: Reword. + * predict.c (expr_expected_value_1): Likewise. + 2018-11-08 Richard Biener PR tree-optimization/87913 diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 8de92da93fb..dc8fc6e2c4a 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12047,7 +12047,7 @@ This function has the same semantics as @code{__builtin_expect}, but the caller provides the expected probability that @var{exp} == @var{c}. The last argument, @var{probability}, is a floating-point value in the range 0.0 to 1.0, inclusive. The @var{probability} argument must be -a compiler time constant. +constant floating-point expression. @end deftypefn @deftypefn {Built-in Function} void __builtin_trap (void) diff --git a/gcc/predict.c b/gcc/predict.c index 80a8d6846f7..8482737ab27 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2470,8 +2470,8 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code, if (TREE_CODE (r) != REAL_CST) { error_at (gimple_location (def), - "probability argument %qE must be a compile " - "time constant", prob); + "probability %qE must be " + "constant floating-point expression", prob); return NULL; } HOST_WIDE_INT probi @@ -2483,8 +2483,8 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code, } else error_at (gimple_location (def), - "probability argument %qE must be a in the " - "range 0.0 to 1.0", prob); + "probability %qE is outside " + "the range [0.0, 1.0]", prob); return gimple_call_arg (def, 1); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3584dfbfded..773fcce06e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Martin Liska + + * gcc.dg/pr87811.c: Update scanned pattern. + * gcc.dg/pr87811-2.c: Likewise. + 2018-11-08 Rainer Orth * g++.dg/lto/pr87906_0.C: Use moon instead of possibly predefined diff --git a/gcc/testsuite/gcc.dg/pr87811-2.c b/gcc/testsuite/gcc.dg/pr87811-2.c index aa30ddff47b..8b0818756e2 100644 --- a/gcc/testsuite/gcc.dg/pr87811-2.c +++ b/gcc/testsuite/gcc.dg/pr87811-2.c @@ -6,7 +6,7 @@ void bar (void); void foo (int i) { - if (__builtin_expect_with_probability (i, 0, 2.0f)) /* { dg-error "probability argument .* must be a in the range 0\\\.0 to 1\\\.0" } */ + if (__builtin_expect_with_probability (i, 0, 2.0f)) /* { dg-error "probability .* is outside the range \\\[0\\\.0, 1\\\.0\\\]" } */ bar (); } diff --git a/gcc/testsuite/gcc.dg/pr87811.c b/gcc/testsuite/gcc.dg/pr87811.c index 9045c8ea957..110b3835975 100644 --- a/gcc/testsuite/gcc.dg/pr87811.c +++ b/gcc/testsuite/gcc.dg/pr87811.c @@ -6,7 +6,7 @@ void bar (void); void foo (int i, double d) { - if (__builtin_expect_with_probability (i, 0, d)) /* { dg-error "probability argument .d. must be a compile time constant" } */ + if (__builtin_expect_with_probability (i, 0, d)) /* { dg-error "probability .d. must be constant floating-point expression" } */ bar (); }