[PATCH][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value'

Jeff Law jeffreyalaw@gmail.com
Wed Nov 3 15:46:24 GMT 2021



On 11/3/2021 5:35 AM, Maciej W. Rozycki wrote:
> Remove a commit 86534c07a390 ("Disable poor value processing in ranger
> cache.") regression that caused GCC not to build anymore if `-Werror'
> has been enabled:
>
> .../gcc/gimple-range-cache.cc: In member function 'bool ranger_cache::push_poor_value(basic_block, tree)':
> .../gcc/gimple-range-cache.cc:850:44: error: unused parameter 'bb' [-Werror=unused-parameter]
>    850 | ranger_cache::push_poor_value (basic_block bb, tree name)
>        |                                ~~~~~~~~~~~~^~
> .../gcc/gimple-range-cache.cc:850:53: error: unused parameter 'name' [-Werror=unused-parameter]
>    850 | ranger_cache::push_poor_value (basic_block bb, tree name)
>        |                                                ~~~~~^~~~
>
> To keep the change to the minimum mark the parameters reported unused.
>
> 	gcc/
> 	* gimple-range-cache.cc (ranger_cache::push_poor_value): Mark
> 	parameters unused.
If possible, just drop the argument's name.  That's the C++ way to deal 
with an unused parameter.   Consider that pre-approved.  If that doesn't 
work, then adding the ATTRIBUTE_UNUSED is then approved.

jeff



More information about the Gcc-patches mailing list