Patchwork [AArch64/AArch64-4.7] Fix warning - Unused variable in aarch64_float_const_representable.

login
register
mail settings
Submitter James Greenhalgh
Date Feb. 28, 2013, 9:38 a.m.
Message ID <1362044310-7748-1-git-send-email-james.greenhalgh@arm.com>
Download mbox | patch
Permalink /patch/223852/
State New
Headers show

Comments

James Greenhalgh - Feb. 28, 2013, 9:38 a.m.
Hi,

In aarch64_float_const_representable, `sign' is unused.

This patch removes all references to it. The patch is equally
applicable to trunk and aarch64-4.7-branch.

This patch fixes the warning:

config/aarch64/aarch64.c: In function ‘aarch64_float_const_representable_p’:
config/aarch64/aarch64.c:7075:7: warning: variable ‘sign’ set but not used [-Wunused-but-set-variable]

Regression tested on aarch64-none-elf with no regressions.

OK for trunk and aarch64-4.7-branch?

Thanks,
James Greenhalgh

---
gcc/

2013-02-28  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c
	(aarch64_float_const_representable): Remove unused variable.
Marcus Shawcroft - Feb. 28, 2013, 4:23 p.m.
OK

On 28 February 2013 09:38, James Greenhalgh <james.greenhalgh@arm.com> wrote:
>
> Hi,
>
> In aarch64_float_const_representable, `sign' is unused.
>
> This patch removes all references to it. The patch is equally
> applicable to trunk and aarch64-4.7-branch.
>
> This patch fixes the warning:
>
> config/aarch64/aarch64.c: In function ‘aarch64_float_const_representable_p’:
> config/aarch64/aarch64.c:7075:7: warning: variable ‘sign’ set but not used [-Wunused-but-set-variable]
>
> Regression tested on aarch64-none-elf with no regressions.
>
> OK for trunk and aarch64-4.7-branch?
>
> Thanks,
> James Greenhalgh
>
> ---
> gcc/
>
> 2013-02-28  James Greenhalgh  <james.greenhalgh@arm.com>
>
>         * config/aarch64/aarch64.c
>         (aarch64_float_const_representable): Remove unused variable.

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index a1e4cdd..8c8532c 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -7088,7 +7088,7 @@  aarch64_float_const_representable_p (rtx x)
   /* This represents our current view of how many bits
      make up the mantissa.  */
   int point_pos = 2 * HOST_BITS_PER_WIDE_INT - 1;
-  int sign, exponent;
+  int exponent;
   unsigned HOST_WIDE_INT mantissa, mask;
   HOST_WIDE_INT m1, m2;
   REAL_VALUE_TYPE r, m;
@@ -7105,8 +7105,7 @@  aarch64_float_const_representable_p (rtx x)
       || REAL_VALUE_MINUS_ZERO (r))
     return false;
 
-  /* Extract sign and exponent.  */
-  sign = REAL_VALUE_NEGATIVE (r) ? 1 : 0;
+  /* Extract exponent.  */
   r = real_value_abs (&r);
   exponent = REAL_EXP (&r);