public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value'
@ 2021-11-03 11:35 Maciej W. Rozycki
  2021-11-03 15:46 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2021-11-03 11:35 UTC (permalink / raw)
  To: gcc-patches

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.
---
Hi,

 Probably obvious, OK to apply?

 [It's been a while since the offending commit; I guess nobody configures
release branches with `--enable-werror-always'?]

  Maciej
---
 gcc/gimple-range-cache.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

gcc-ranger-cache-push-poor-value-unused.diff
Index: gcc/gcc/gimple-range-cache.cc
===================================================================
--- gcc.orig/gcc/gimple-range-cache.cc
+++ gcc/gcc/gimple-range-cache.cc
@@ -847,7 +847,8 @@ ranger_cache::register_dependency (tree
 // the request is actually made (ie, isn't a duplicate).
 
 bool
-ranger_cache::push_poor_value (basic_block bb, tree name)
+ranger_cache::push_poor_value (basic_block bb ATTRIBUTE_UNUSED,
+			       tree name ATTRIBUTE_UNUSED)
 {
   // Disable poor value processing for GCC 11.  It has been disabled in GCC 12
   // as adding too much churn/compile time for too little benefit.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value'
  2021-11-03 11:35 [PATCH][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value' Maciej W. Rozycki
@ 2021-11-03 15:46 ` Jeff Law
  2021-11-03 22:10   ` [committed v2][GCC " Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2021-11-03 15:46 UTC (permalink / raw)
  To: Maciej W. Rozycki, gcc-patches



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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [committed v2][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value'
  2021-11-03 15:46 ` Jeff Law
@ 2021-11-03 22:10   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2021-11-03 22:10 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

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.
---
On Wed, 3 Nov 2021, Jeff Law wrote:

> 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.

 Umm, my 1990s dated proper C++ experience is surely rusty, disused and 
likely outdated.  Thanks for the hint.

 Applied as shown then.  Thanks for your review.

  Maciej
---
 gcc/gimple-range-cache.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-ranger-cache-push-poor-value-unused.diff
Index: gcc/gcc/gimple-range-cache.cc
===================================================================
--- gcc.orig/gcc/gimple-range-cache.cc
+++ gcc/gcc/gimple-range-cache.cc
@@ -847,7 +847,7 @@ ranger_cache::register_dependency (tree
 // the request is actually made (ie, isn't a duplicate).
 
 bool
-ranger_cache::push_poor_value (basic_block bb, tree name)
+ranger_cache::push_poor_value (basic_block, tree)
 {
   // Disable poor value processing for GCC 11.  It has been disabled in GCC 12
   // as adding too much churn/compile time for too little benefit.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-03 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 11:35 [PATCH][GCC 11] ranger: Fix `-Werror' build error with `ranger_cache::push_poor_value' Maciej W. Rozycki
2021-11-03 15:46 ` Jeff Law
2021-11-03 22:10   ` [committed v2][GCC " Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).