public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] Fix static analysis warnings in arm backend
@ 2017-06-23 20:44 Michael Collison
  2017-06-23 21:37 ` Eric Gallager
  2017-06-26 10:47 ` Kyrill Tkachov
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Collison @ 2017-06-23 20:44 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd

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

This patch cleans up warning messages due to unused variables and overly complicated loop structures.

Okay for trunk?

2017-03-30  Michael Collison  <michael.collison@arm.com>

	PR target/68535
	* config/arm/arm.c (gen_ldm_seq): Remove last unnecessary
	set of base_reg
	(arm_gen_movmemqi): Removed unused variable 'i'.
	Convert 'for' loop into 'while' loop.
	(arm_expand_prologue): Remove last unnecessary set of insn.
	(thumb_pop): Remove unused variable 'pushed_words'.
	(thumb_exit): Remove last unnecessary set of regs_to_pop.

[-- Attachment #2: pr6294.patch --]
[-- Type: application/octet-stream, Size: 2061 bytes --]

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b24143e..0ef421b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -13521,10 +13521,7 @@ gen_ldm_seq (rtx *operands, int nops, bool sort_regs)
       emit_insn (gen_addsi3 (newbase, base_reg_rtx, GEN_INT (offset)));
       offset = 0;
       if (!TARGET_THUMB1)
-	{
-	  base_reg = regs[0];
-	  base_reg_rtx = newbase;
-	}
+	base_reg_rtx = newbase;
     }
 
   for (i = 0; i < nops; i++)
@@ -14048,7 +14045,6 @@ arm_gen_movmemqi (rtx *operands)
 {
   HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes;
   HOST_WIDE_INT srcoffset, dstoffset;
-  int i;
   rtx src, dst, srcbase, dstbase;
   rtx part_bytes_reg = NULL;
   rtx mem;
@@ -14078,7 +14074,7 @@ arm_gen_movmemqi (rtx *operands)
   if (out_words_to_go != in_words_to_go && ((in_words_to_go - 1) & 3) != 0)
     part_bytes_reg = gen_rtx_REG (SImode, (in_words_to_go - 1) & 3);
 
-  for (i = 0; in_words_to_go >= 2; i+=4)
+  while (in_words_to_go >= 2)
     {
       if (in_words_to_go > 4)
 	emit_insn (arm_gen_load_multiple (arm_regs_in_sequence, 4, src,
@@ -21621,8 +21617,8 @@ arm_expand_prologue (void)
 	 will prevent the scheduler from moving stores to the frame
 	 before the stack adjustment.  */
       if (frame_pointer_needed)
-	insn = emit_insn (gen_stack_tie (stack_pointer_rtx,
-					 hard_frame_pointer_rtx));
+	emit_insn (gen_stack_tie (stack_pointer_rtx,
+				  hard_frame_pointer_rtx));
     }
 
 
@@ -23707,7 +23703,6 @@ thumb_pop (FILE *f, unsigned long mask)
 {
   int regno;
   int lo_mask = mask & 0xFF;
-  int pushed_words = 0;
 
   gcc_assert (mask);
 
@@ -23730,8 +23725,6 @@ thumb_pop (FILE *f, unsigned long mask)
 
 	  if ((lo_mask & ~1) != 0)
 	    fprintf (f, ", ");
-
-	  pushed_words++;
 	}
     }
 
@@ -24001,9 +23994,6 @@ thumb_exit (FILE *f, int reg_containing_return_addr)
       move_to     = number_of_first_bit_set (regs_to_pop);
 
       asm_fprintf (f, "\tmov\t%r, %r\n", move_to, popped_into);
-
-      regs_to_pop &= ~(1 << move_to);
-
       --pops_needed;
     }
 
-- 
1.9.1


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

* Re: [PATCH][ARM] Fix static analysis warnings in arm backend
  2017-06-23 20:44 [PATCH][ARM] Fix static analysis warnings in arm backend Michael Collison
@ 2017-06-23 21:37 ` Eric Gallager
  2017-06-23 21:43   ` Michael Collison
  2017-06-26 10:47 ` Kyrill Tkachov
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Gallager @ 2017-06-23 21:37 UTC (permalink / raw)
  To: Michael Collison; +Cc: GCC Patches, nd

On 6/23/17, Michael Collison <Michael.Collison@arm.com> wrote:
> This patch cleans up warning messages due to unused variables and overly
> complicated loop structures.
>
> Okay for trunk?
>
> 2017-03-30  Michael Collison  <michael.collison@arm.com>
>
> 	PR target/68535
> 	* config/arm/arm.c (gen_ldm_seq): Remove last unnecessary
> 	set of base_reg
> 	(arm_gen_movmemqi): Removed unused variable 'i'.
> 	Convert 'for' loop into 'while' loop.
> 	(arm_expand_prologue): Remove last unnecessary set of insn.
> 	(thumb_pop): Remove unused variable 'pushed_words'.
> 	(thumb_exit): Remove last unnecessary set of regs_to_pop.
>

What were the actual warning messages, could you post those?
Eric

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

* RE: [PATCH][ARM] Fix static analysis warnings in arm backend
  2017-06-23 21:37 ` Eric Gallager
@ 2017-06-23 21:43   ` Michael Collison
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Collison @ 2017-06-23 21:43 UTC (permalink / raw)
  To: Eric Gallager; +Cc: GCC Patches, nd

Hi Eric,

The warnings are listed in the PR here:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68535

Regards,

Michael Collison

-----Original Message-----
From: Eric Gallager [mailto:egall@gwmail.gwu.edu] 
Sent: Friday, June 23, 2017 2:37 PM
To: Michael Collison <Michael.Collison@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>; nd <nd@arm.com>
Subject: Re: [PATCH][ARM] Fix static analysis warnings in arm backend

On 6/23/17, Michael Collison <Michael.Collison@arm.com> wrote:
> This patch cleans up warning messages due to unused variables and 
> overly complicated loop structures.
>
> Okay for trunk?
>
> 2017-03-30  Michael Collison  <michael.collison@arm.com>
>
> 	PR target/68535
> 	* config/arm/arm.c (gen_ldm_seq): Remove last unnecessary
> 	set of base_reg
> 	(arm_gen_movmemqi): Removed unused variable 'i'.
> 	Convert 'for' loop into 'while' loop.
> 	(arm_expand_prologue): Remove last unnecessary set of insn.
> 	(thumb_pop): Remove unused variable 'pushed_words'.
> 	(thumb_exit): Remove last unnecessary set of regs_to_pop.
>

What were the actual warning messages, could you post those?
Eric

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

* Re: [PATCH][ARM] Fix static analysis warnings in arm backend
  2017-06-23 20:44 [PATCH][ARM] Fix static analysis warnings in arm backend Michael Collison
  2017-06-23 21:37 ` Eric Gallager
@ 2017-06-26 10:47 ` Kyrill Tkachov
  1 sibling, 0 replies; 4+ messages in thread
From: Kyrill Tkachov @ 2017-06-26 10:47 UTC (permalink / raw)
  To: Michael Collison, GCC Patches; +Cc: nd

Hi Michael,

On 23/06/17 21:44, Michael Collison wrote:
> This patch cleans up warning messages due to unused variables and overly complicated loop structures.
>
> Okay for trunk?

Ok.
Thanks,
Kyrill

> 2017-03-30  Michael Collison  <michael.collison@arm.com>
>
> 	PR target/68535
> 	* config/arm/arm.c (gen_ldm_seq): Remove last unnecessary
> 	set of base_reg
> 	(arm_gen_movmemqi): Removed unused variable 'i'.
> 	Convert 'for' loop into 'while' loop.
> 	(arm_expand_prologue): Remove last unnecessary set of insn.
> 	(thumb_pop): Remove unused variable 'pushed_words'.
> 	(thumb_exit): Remove last unnecessary set of regs_to_pop.

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

end of thread, other threads:[~2017-06-26 10:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 20:44 [PATCH][ARM] Fix static analysis warnings in arm backend Michael Collison
2017-06-23 21:37 ` Eric Gallager
2017-06-23 21:43   ` Michael Collison
2017-06-26 10:47 ` Kyrill Tkachov

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