From patchwork Wed Nov 16 01:39:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 17500 Received: (qmail 30026 invoked by alias); 16 Nov 2016 01:40:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29987 invoked by uid 89); 16 Nov 2016 01:40:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=2016-11-16, Hx-languages-length:1527, 20161116 X-HELO: relay1.mentorg.com Date: Wed, 16 Nov 2016 01:39:51 +0000 From: Joseph Myers To: Mike Frysinger CC: Subject: Re: Fix SH4 register-dump.h for soft-float In-Reply-To: <20161115204910.GE21655@vapier.lan> Message-ID: References: <20161115204910.GE21655@vapier.lan> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) On Tue, 15 Nov 2016, Mike Frysinger wrote: > seems like you could just move it into the existing ifdef scope > rather than duplicating the logic ? fpregs is only used inside > of an existing if(){...} scope. Here is a patch which does that. (To be clear, it has to stay outside the if (), because pointers into it are used by writev after that if () has finished, so it needs to be live at that point.) Fix SH4 register-dump.h for soft-float. This patch fixes SH4 register-dump.h to declare a variable inside the #ifdef in it is used, to avoid an unused variable error breaking the build for soft-float. Tested (compilation only) for SH4 soft-float. 2016-11-16 Joseph Myers * sysdeps/unix/sysv/linux/sh/sh4/register-dump.h (register_dump): Only declare fpregs if [__SH_FPU_ANY__]. diff --git a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h index 4a642ab..519a2ce 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h +++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h @@ -56,7 +56,6 @@ static void register_dump (int fd, struct sigcontext *ctx) { char regs[22][8]; - char fpregs[34][8]; struct iovec iov[22 * 2 + 34 * 2 + 2]; size_t nr = 0; @@ -144,6 +143,7 @@ register_dump (int fd, struct sigcontext *ctx) ADD_STRING ("\n"); #ifdef __SH_FPU_ANY__ + char fpregs[34][8]; if (ctx->sc_ownedfp != 0) { hexvalue (ctx->sc_fpregs[0], fpregs[0], 8);