This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix warning in insn-attrtab.c


Hello,

bootstrap on s390-ibm-linux fails after the switch to -Werror
due to the following function generated into insn-attrtab.c:

int
function_units_used (insn)
     rtx insn;
{
  unsigned long accum = 0;

  accum |= (1);

  if (accum && accum == (accum & -accum))
    {
      int i;
      for (i = 0; accum >>= 1; ++i) continue;
      accum = i;
    }
  else
    accum = ~accum;
  return accum;
}

Note that the parameter insn is unused, causing a warning.

I'd suggest to simply mark insn as potentially unused,
which the following patch implements.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
OK to commit?

ChangeLog:

	* genattrtab.c (write_attr_get): Mark 'insn' paramter
	as ATTRIBUTE_UNUSED.

Index: gcc/genattrtab.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genattrtab.c,v
retrieving revision 1.124
diff -c -p -r1.124 genattrtab.c
*** gcc/genattrtab.c	20 Jan 2003 22:49:33 -0000	1.124
--- gcc/genattrtab.c	22 Jan 2003 20:33:31 -0000
*************** write_attr_get (attr)
*** 5021,5027 ****
        return;
      }
  
!   printf ("     rtx insn;\n");
    printf ("{\n");
  
    if (GET_CODE (common_av->value) == FFS)
--- 5021,5027 ----
        return;
      }
  
!   printf ("     rtx insn ATTRIBUTE_UNUSED;\n");
    printf ("{\n");
  
    if (GET_CODE (common_av->value) == FFS)
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]