public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Fix SH4 register-dump.h for soft-float
@ 2016-11-07 23:19 Joseph Myers
  2016-11-14 23:38 ` Ping " Joseph Myers
  2016-11-15 20:49 ` Mike Frysinger
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Myers @ 2016-11-07 23:19 UTC (permalink / raw)
  To: libc-alpha

This patch fixes SH4 register-dump.h to declare a variable under the
same conditions on which it is used, to avoid an unused variable error
breaking the build for soft-float.

Tested (compilation only, in conjunction with other fixes) for SH4
soft-float.

2016-11-07  Joseph Myers  <joseph@codesourcery.com>

	* 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..154824d 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
@@ -56,7 +56,9 @@ static void
 register_dump (int fd, struct sigcontext *ctx)
 {
   char regs[22][8];
+#ifdef __SH_FPU_ANY__
   char fpregs[34][8];
+#endif
   struct iovec iov[22 * 2 + 34 * 2 + 2];
   size_t nr = 0;
 

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Ping Re: Fix SH4 register-dump.h for soft-float
  2016-11-07 23:19 Fix SH4 register-dump.h for soft-float Joseph Myers
@ 2016-11-14 23:38 ` Joseph Myers
  2016-11-15 20:49 ` Mike Frysinger
  1 sibling, 0 replies; 5+ messages in thread
From: Joseph Myers @ 2016-11-14 23:38 UTC (permalink / raw)
  To: libc-alpha

Ping.  This patch 
<https://sourceware.org/ml/libc-alpha/2016-11/msg00257.html> is pending 
review.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix SH4 register-dump.h for soft-float
  2016-11-07 23:19 Fix SH4 register-dump.h for soft-float Joseph Myers
  2016-11-14 23:38 ` Ping " Joseph Myers
@ 2016-11-15 20:49 ` Mike Frysinger
  2016-11-16  1:40   ` Joseph Myers
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2016-11-15 20:49 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On 07 Nov 2016 23:18, Joseph Myers wrote:
> This patch fixes SH4 register-dump.h to declare a variable under the
> same conditions on which it is used, to avoid an unused variable error
> breaking the build for soft-float.
> 
> Tested (compilation only, in conjunction with other fixes) for SH4
> soft-float.
> 
> 2016-11-07  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* sysdeps/unix/sysv/linux/sh/sh4/register-dump.h (register_dump):
> 	Only declare fpregs if [__SH_FPU_ANY__].
> 
> --- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
> +++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
> @@ -56,7 +56,9 @@ static void
>  register_dump (int fd, struct sigcontext *ctx)
>  {
>    char regs[22][8];
> +#ifdef __SH_FPU_ANY__
>    char fpregs[34][8];
> +#endif
>    struct iovec iov[22 * 2 + 34 * 2 + 2];
>    size_t nr = 0;

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.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix SH4 register-dump.h for soft-float
  2016-11-15 20:49 ` Mike Frysinger
@ 2016-11-16  1:40   ` Joseph Myers
  2016-11-16  3:16     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2016-11-16  1:40 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-alpha

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  <joseph@codesourcery.com>

	* 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);

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix SH4 register-dump.h for soft-float
  2016-11-16  1:40   ` Joseph Myers
@ 2016-11-16  3:16     ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2016-11-16  3:16 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On 16 Nov 2016 01:39, Joseph Myers wrote:
> 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.

OK
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-16  3:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 23:19 Fix SH4 register-dump.h for soft-float Joseph Myers
2016-11-14 23:38 ` Ping " Joseph Myers
2016-11-15 20:49 ` Mike Frysinger
2016-11-16  1:40   ` Joseph Myers
2016-11-16  3:16     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).