diff mbox series

[committed,PR,bootstrap/93962] Fix bootstrap issue on freebsd

Message ID c1cb07d0768092908b9291fc115eef0ad56dc5d2.camel@redhat.com
State New
Headers show
Series [committed,PR,bootstrap/93962] Fix bootstrap issue on freebsd | expand

Commit Message

Jeff Law March 4, 2020, 11:26 p.m. UTC
PR 93962 reports a bootstrap failure on FreeBSD 11.3 due to a format warning.

Andrew Pinski recommended using std::abs rather than a naked abs.  I bootstrapped
and regression tested that on x86_64-linux-gnu.

I was unable to reproduce the failure in a FreeBSD VM.  However Gerald (the
reporter) was able to confirm that using std::abs worked to fix the problem in
their builds.

I'm committing the change to std::abs based on Gerald's testing as well as my
own.  I'm going to remove the regression marker, but keep the BZ open as Jakub
wants the CPP output to try and figure out what's going on at a deeper level.

Jeff
commit 20a235a8b443a81ea0ec6a10f260b119f2193a69
Author: Jeff Law <law@redhat.com>
Date:   Wed Mar 4 16:25:11 2020 -0700

    Fix format warning which showed up on FreeBSD 11.3.
    
            PR bootstrap/93962
            * value-prof.c (dump_histogram_value): Use std::abs.
diff mbox series

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0df606a8211..5b2e4a83721 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2020-03-04  Andrew Pinski  <apinski@marvell.com>
+
+	PR bootstrap/93962
+	* value-prof.c (dump_histogram_value): Use std::abs.
+
 2020-03-04  Martin Sebor  <msebor@redhat.com>
 
 	PR tree-optimization/93986
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 8e9f129708a..585b909096f 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -266,7 +266,7 @@  dump_histogram_value (FILE *dump_file, histogram_value hist)
 	  if (hist->hvalue.counters)
 	    {
 	      fprintf (dump_file, " all: %" PRId64 "%s, values: ",
-		       abs ((int64_t) hist->hvalue.counters[0]),
+		       std::abs ((int64_t) hist->hvalue.counters[0]),
 		       hist->hvalue.counters[0] < 0
 		       ? " (values missing)": "");
 	      for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++)