Hi,

It is customary to mark the gate and execute functions of the classes
representing passes as final override but this is missing in
pass_rtl_avoid_store_forwarding.  This patch adds it which also
silences a clang warning about it.

Bootstrapped and tested on x86_64-linux.  Because of the precedent
elsewhere I consider this obvious and will commit it shortly.

Thanks,

Martin


gcc/ChangeLog:

2025-06-24  Martin Jambor  <mjam...@suse.cz>

        * avoid-store-forwarding.cc (class
        pass_rtl_avoid_store_forwarding): Mark member function gate as
        final override.
---
 gcc/avoid-store-forwarding.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/avoid-store-forwarding.cc b/gcc/avoid-store-forwarding.cc
index 6825d0426ec..37e095316c9 100644
--- a/gcc/avoid-store-forwarding.cc
+++ b/gcc/avoid-store-forwarding.cc
@@ -80,12 +80,12 @@ public:
   {}
 
   /* opt_pass methods: */
-  virtual bool gate (function *)
+  virtual bool gate (function *) final override
     {
       return flag_avoid_store_forwarding && optimize >= 1;
     }
 
-  virtual unsigned int execute (function *) override;
+  virtual unsigned int execute (function *) final override;
 }; // class pass_rtl_avoid_store_forwarding
 
 /* Handler for finding and avoiding store forwardings.  */
-- 
2.49.0

Reply via email to