In predicates.md, we have a predicate like this:
(define_special_predicate "esirisc_simd_shift_reg_operand"
(match_operand 0 "d_register_operand")
{
/* Earlier revs shifted both halves by the same amount, which is not usable.
*/
return esirisc_rev_option > 10;
})
genpreds generates for that:
static inline int
esirisc_simd_shift_reg_operand_1 (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
#line 300 "../../gcc/trunk/gcc/gcc/config/esirisc/predicates.md"
{
/* Earlier revs shifted both halves by the same amount, which is not usable.
*/
return esirisc_rev_option > 10;
}
which means that insn-preds.c fails to build when gcc is configured
with --enable-werror-always .
Fixed with the following patch. Bootstrapped in r263928 on x86_64-pc-linux-gnu.
OK to apply?
2018-08-28 Joern Rennecke <[email protected]>
* genpreds.c (write_predicate_subfunction): Also add ATTRIBUTE_UNUSED
to OP parmeter of generated function.
Index: genpreds.c
===================================================================
--- genpreds.c (revision 5271)
+++ genpreds.c (working copy)
@@ -152,7 +152,7 @@ write_predicate_subfunction (struct pred
p->exp = and_exp;
printf ("static inline int\n"
- "%s_1 (rtx op, machine_mode mode ATTRIBUTE_UNUSED)\n",
+ "%s_1 (rtx op ATTRIBUTE_UNUSED, machine_mode mode
ATTRIBUTE_UNUSED)\n",
p->name);
rtx_reader_ptr->print_md_ptr_loc (p->c_block);
if (p->c_block[0] == '{')