Change wording of __builtin_expect_with_probability errors.
authorMartin Liska <mliska@suse.cz>
Thu, 8 Nov 2018 08:50:49 +0000 (09:50 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 8 Nov 2018 08:50:49 +0000 (08:50 +0000)
2018-11-08  Martin Liska  <mliska@suse.cz>

* doc/extend.texi: Reword.
* predict.c (expr_expected_value_1): Likewise.
2018-11-08  Martin Liska  <mliska@suse.cz>

* gcc.dg/pr87811.c: Update scanned pattern.
* gcc.dg/pr87811-2.c: Likewise.

From-SVN: r265911

gcc/ChangeLog
gcc/doc/extend.texi
gcc/predict.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr87811-2.c
gcc/testsuite/gcc.dg/pr87811.c

index 270180f..145195c 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-08  Martin Liska  <mliska@suse.cz>
+
+       * doc/extend.texi: Reword.
+       * predict.c (expr_expected_value_1): Likewise.
+
 2018-11-08  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87913
index 8de92da..dc8fc6e 100644 (file)
@@ -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)
index 80a8d68..8482737 100644 (file)
@@ -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);
                }
index 3584dfb..773fcce 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-08  Martin Liska  <mliska@suse.cz>
+
+       * gcc.dg/pr87811.c: Update scanned pattern.
+       * gcc.dg/pr87811-2.c: Likewise.
+
 2018-11-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * g++.dg/lto/pr87906_0.C: Use moon instead of possibly predefined
index aa30ddf..8b08187 100644 (file)
@@ -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 ();
 }
 
index 9045c8e..110b383 100644 (file)
@@ -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 ();
 }