https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94629

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Jakub Jelinek from comment #5)
> We should for GCC11 discuss if we want to implement some of these checks,
> either in -fanalyzer, or as normal GCC warnings.
> E.g. the
>  foo = something;
>  // code that can't affect foo
>  foo = somethingelse;
> is perhaps something that should be warned as early as possible after
> getting into GIMPLE, before inlining because it is quite common that inlines
> overwrite something, and in the FEs it is likely too early.

A quick look at recent cppcheck output over the gcc trunk source code
suggests that there are 162 cases of redundant assignment like this.

Some of them might well be false positives.

Reply via email to