From owner-svn-src-head@freebsd.org Sat Jan 13 04:53:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA6FE73839; Sat, 13 Jan 2018 04:53:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 710BA73D06; Sat, 13 Jan 2018 04:53:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A33B664CE; Sat, 13 Jan 2018 04:53:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D4r4dL038020; Sat, 13 Jan 2018 04:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D4r4jD038019; Sat, 13 Jan 2018 04:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801130453.w0D4r4jD038019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 04:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327911 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 327911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jan 2018 04:53:05 -0000 Author: jhibbits Date: Sat Jan 13 04:53:04 2018 New Revision: 327911 URL: https://svnweb.freebsd.org/changeset/base/327911 Log: Replace the PMC class struct copy with an explicit memcpy() This should be effectively a nop for all archs, but for some reason the codegen difference on the PowerPC 970 is such that the struct assignment doesn't work (unless a printf() using one of the elements in the copied struct follows it), while the memcpy() succeeds. On all archs the memcpy() should be expanded to an inline copy, since the copy is bounded to ~16 bytes. MFC after: 3 weeks Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Sat Jan 13 04:00:55 2018 (r327910) +++ head/lib/libpmc/libpmc.c Sat Jan 13 04:53:04 2018 (r327911) @@ -3270,7 +3270,8 @@ pmc_init(void) cpu_info.pm_npmc = op_cpu_info.pm_npmc; cpu_info.pm_nclass = op_cpu_info.pm_nclass; for (n = 0; n < cpu_info.pm_nclass; n++) - cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n]; + memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n], + sizeof(cpu_info.pm_classes[n])); pmc_class_table = malloc(PMC_CLASS_TABLE_SIZE * sizeof(struct pmc_class_descr *));