From c5e0ba5fe4968aa928f461e6efd1ea3f898ebea0 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 30 Jun 2010 01:40:25 +0000 Subject: [PATCH] On powerpc, calculate s_scale using the non-FP version previously specific to hp300. Since FreeBSD does not support hp300, hp300 has been removed from the condition altogether. The FP version broke profiling on powerpc due to invalid results. Casting to double instead of float resolved the issue, but with Book-E not having a FP unit, the non-FP version looked preferrable. Note that even on AIM hardware the FP version yielded an invalid value for s_scale, so the problem is most likely with the compiler or with the expression itself. --- lib/libc/gmon/gmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index fe769e88bdc2..9b1406a7981d 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -111,7 +111,7 @@ monstartup(lowpc, highpc) o = p->highpc - p->lowpc; if (p->kcountsize < o) { -#ifndef hp300 +#if !defined(__powerpc__) s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1; #else /* avoid floating point */ int quot = o / p->kcountsize;