Bug 110205 - Some new warnings from clang for the range code
Summary: Some new warnings from clang for the range code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Not yet assigned to anyone
URL:
Keywords: internal-improvement
Depends on:
Blocks:
 
Reported: 2023-06-11 07:17 UTC by David Binderman
Modified: 2024-01-20 17:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2023-06-11 07:17:26 UTC
I just did a build of gcc trunk with clang. It said

../../trunk.year/gcc/range-op-mixed.h:215:8: warning: 'fold_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op-mixed.h:222:8: warning: 'op1_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op-mixed.h:229:8: warning: 'op2_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op-mixed.h:236:8: warning: 'update_bitmask' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:169:16: warning: unused variable 'RO_FII' [-Wunused-const-variable]
../../trunk.year/gcc/range-op.cc:2292:8: warning: 'update_bitmask' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

These might be worth fixing. The unused variable might be a typo or some missing code.
Comment 1 Andrew Macleod 2023-06-12 13:30:40 UTC
There is a second set of patches coming, I will make sure anything that remains from this list is addressed when they go in.
Comment 2 GCC Commits 2023-06-12 15:33:15 UTC
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:0ddc8c7871fdc7748315d9c09fcf29c2607a1077

commit r14-1735-g0ddc8c7871fdc7748315d9c09fcf29c2607a1077
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Jun 12 09:47:43 2023 -0400

    Add some overrides.
    
            PR tree-optimization/110205
            * range-op-float.cc (range_operator::fold_range): Add default FII
            fold routine.
            * range-op-mixed.h (class operator_gt): Add missing final overrides.
            * range-op.cc (range_op_handler::fold_range): Add RO_FII case.
            (operator_lshift ::update_bitmask): Add final override.
            (operator_rshift ::update_bitmask): Add final override.
            * range-op.h (range_operator::fold_range): Add FII prototype.
Comment 3 David Binderman 2023-07-10 14:19:29 UTC
Nearly a month later, the current list of clang warnings for the range code is:

../../trunk.year/gcc/gimple-range-cache.h:140:17: warning: private field 'm_estimate' is not used [-Wunused-private-field]
../../trunk.year/gcc/range-op-mixed.h:567:8: warning: 'op1_op2_relation_effect' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2254:8: warning: 'update_bitmask' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2392:16: warning: 'op1_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2396:16: warning: 'fold_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2401:16: warning: 'wi_fold' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2404:16: warning: 'wi_op_overflows' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2419:16: warning: 'fold_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2423:16: warning: 'wi_fold' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2428:16: warning: 'wi_op_overflows' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2432:16: warning: 'op1_range' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
../../trunk.year/gcc/range-op.cc:2436:25: warning: 'lhs_op1_relation' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

These might be worth fixing.
Comment 4 Xi Ruoyao 2023-07-10 17:38:21 UTC
We need a general decision.  If we think these warning must fixed, we'd better enable the equivalent GCC warnings for bootstrapping too.
Comment 5 GCC Commits 2023-07-28 20:37:51 UTC
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:7905c071c35070fff3397b1e24f140c128c08e64

commit r14-2859-g7905c071c35070fff3397b1e24f140c128c08e64
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Jul 10 13:58:22 2023 -0400

    Fix some warnings
    
            PR tree-optimization/110205
            * gimple-range-cache.h (ranger_cache::m_estimate): Delete.
            * range-op-mixed.h (operator_bitwise_xor::op1_op2_relation_effect):
            Add final override.
            * range-op.cc (operator_lshift): Add missing final overrides.
            (operator_rshift): Ditto.
Comment 6 Andrew Macleod 2024-01-16 18:44:33 UTC
fixed.