diff mbox

[AArch64] Fix some warnings about unused variables.

Message ID 1355839344-13411-1-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh Dec. 18, 2012, 2:02 p.m. UTC
Hi,

This straightforward patch fixes the following warnings I see when building
for AArch64.

gcc/config/aarch64/aarch64.c:6385:7: warning: unused variable ‘reg’ [-Wunused-variable]
gcc/config/aarch64/aarch64.c:6385:12: warning: unused variable ‘mem’ [-Wunused-variable]
gcc/config/aarch64/aarch64.c:6385:17: warning: unused variable ‘addr’ [-Wunused-variable]
gcc/config/aarch64/aarch64.c:6386:7: warning: unused variable ‘load’ [-Wunused-variable]
gcc/config/aarch64/aarch64.c:6669:17: warning: variable ‘mod_s’ set but not used [-Wunused-but-set-variable]

Regression tested on aarch64-none-elf with no regressions and checked
to ensure that the warnings go away.

OK to commit?

Thanks,
James Greenhalgh

---
gcc/

2012-12-18  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c (aarch64_simd_attr_length_move):
	Remove unused variables.
	(aarch64_split_compare_and_swap): Likewise.

Comments

Richard Earnshaw Dec. 18, 2012, 4:36 p.m. UTC | #1
On 18/12/12 14:02, James Greenhalgh wrote:
> Hi,
>
> This straightforward patch fixes the following warnings I see when building
> for AArch64.
>
> gcc/config/aarch64/aarch64.c:6385:7: warning: unused variable ‘reg’ [-Wunused-variable]
> gcc/config/aarch64/aarch64.c:6385:12: warning: unused variable ‘mem’ [-Wunused-variable]
> gcc/config/aarch64/aarch64.c:6385:17: warning: unused variable ‘addr’ [-Wunused-variable]
> gcc/config/aarch64/aarch64.c:6386:7: warning: unused variable ‘load’ [-Wunused-variable]
> gcc/config/aarch64/aarch64.c:6669:17: warning: variable ‘mod_s’ set but not used [-Wunused-but-set-variable]
>
> Regression tested on aarch64-none-elf with no regressions and checked
> to ensure that the warnings go away.
>
> OK to commit?
>

OK.

R.

> Thanks,
> James Greenhalgh
>
> ---
> gcc/
>
> 2012-12-18  James Greenhalgh  <james.greenhalgh@arm.com>
>
> 	* config/aarch64/aarch64.c (aarch64_simd_attr_length_move):
> 	Remove unused variables.
> 	(aarch64_split_compare_and_swap): Likewise.
>
>
> 0001-AArch64-Fix-some-warnings-about-unused-variables.patch
>
>
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 09b1777..03b1361 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -6382,8 +6382,6 @@ aarch64_simd_disambiguate_copy (rtx *operands, rtx *dest,
>   int
>   aarch64_simd_attr_length_move (rtx insn)
>   {
> -  rtx reg, mem, addr;
> -  int load;
>     enum machine_mode mode;
>
>     extract_insn_cached (insn);
> @@ -6666,7 +6664,6 @@ aarch64_split_compare_and_swap (rtx operands[])
>   {
>     rtx rval, mem, oldval, newval, scratch;
>     enum machine_mode mode;
> -  enum memmodel mod_s;
>     bool is_weak;
>     rtx label1, label2, x, cond;
>
> @@ -6675,7 +6672,6 @@ aarch64_split_compare_and_swap (rtx operands[])
>     oldval = operands[2];
>     newval = operands[3];
>     is_weak = (operands[4] != const0_rtx);
> -  mod_s = (enum memmodel) INTVAL (operands[5]);
>     scratch = operands[7];
>     mode = GET_MODE (mem);
>
>
James Greenhalgh Jan. 2, 2013, 4:24 p.m. UTC | #2
> OK.
> 
> R.

Thanks Richard,

I've also backported this to aarch64-4.7-branch and committed
it as revision 194808.

Cheers,
James Greenhalgh
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 09b1777..03b1361 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -6382,8 +6382,6 @@  aarch64_simd_disambiguate_copy (rtx *operands, rtx *dest,
 int
 aarch64_simd_attr_length_move (rtx insn)
 {
-  rtx reg, mem, addr;
-  int load;
   enum machine_mode mode;
 
   extract_insn_cached (insn);
@@ -6666,7 +6664,6 @@  aarch64_split_compare_and_swap (rtx operands[])
 {
   rtx rval, mem, oldval, newval, scratch;
   enum machine_mode mode;
-  enum memmodel mod_s;
   bool is_weak;
   rtx label1, label2, x, cond;
 
@@ -6675,7 +6672,6 @@  aarch64_split_compare_and_swap (rtx operands[])
   oldval = operands[2];
   newval = operands[3];
   is_weak = (operands[4] != const0_rtx);
-  mod_s = (enum memmodel) INTVAL (operands[5]);
   scratch = operands[7];
   mode = GET_MODE (mem);