]> git.ipfire.org Git - thirdparty/gcc.git/commit
genmatch: Avoid unused parameter warnings in generated code.
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 3 Aug 2020 12:10:45 +0000 (13:10 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:20:39 +0000 (13:20 -0300)
commit9bdf86599ab5f8398afd3c6db2bc7e1ff6dd99f4
treec5591e4ec62ffe6dd813f812807232aa2fcf0b20
parentdd68c9fef045ef400d132c306532e464af02879c
genmatch: Avoid unused parameter warnings in generated code.

This patch silences a number of unused parameter warnings whilst
compiling both generic-match.c and gimple-match.c.  The problem is
that multiple (polymorphic) functions are generated for generic_simplify
and gimple_simplify, each handling tree codes with a specific number
of children.  Currently, there are no simplifications for tree codes
with four or five children, leading to functions with "empty" bodies
and unused function arguments.  This patch detects those cases, and
generates stub functions (with anonymous arguments) to silence these
warnings.

2020-08-03  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* genmatch.c (decision_tree::gen): Emit stub functions for
tree code operand counts that have no simplifications.
(main): Correct comment typo.
gcc/genmatch.c