Patchwork [committed] Fix -Wunused warning in regrename.c (PR middle-end/46844)

login
register
mail settings
Submitter Jakub Jelinek
Date Dec. 8, 2010, 4:45 p.m.
Message ID <20101208164550.GG29412@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/74747/
State New
Headers show

Comments

Jakub Jelinek - Dec. 8, 2010, 4:45 p.m.
Hi!

REG argument is only used if one of the target macros is defined,
so on some targets we warn that reg is unused.  Fixed thusly,
bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.

2010-12-08  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/46844
	* regrename.c (check_new_reg_p): Add ATTRIBUTE_UNUSED to reg
	parameter.


	Jakub

Patch

--- gcc/regrename.c.jj	2010-12-07 17:32:49.000000000 +0100
+++ gcc/regrename.c	2010-12-08 13:21:24.000000000 +0100
@@ -309,8 +309,8 @@  sort_du_head (struct du_head **head)
    registers.  */
 
 static bool
-check_new_reg_p (int reg, int new_reg,  struct du_head *this_head,
-		 HARD_REG_SET this_unavailable)
+check_new_reg_p (int reg ATTRIBUTE_UNUSED, int new_reg,
+		 struct du_head *this_head, HARD_REG_SET this_unavailable)
 {
   enum machine_mode mode = GET_MODE (*this_head->first->loc);
   int nregs = hard_regno_nregs[new_reg][mode];