On Mon, Oct 6, 2025 at 5:58 PM Sam James <[email protected]> wrote:
>
> CCP interacts poorly with -Wuninitialized in some cases by assuming a value
> which stops us warning about it (false negatives). Inform users about this
> infamous interaction.
>
> gcc/ChangeLog:
>         PR tree-optimization/18501
>
>         * doc/invoke.texi (-Wuninitialized): Mention interaction with CCP.
> ---
> We give some 'more effective' notes like this for -ftree-vrp. What do you 
> think?
Not a fan at all of the "more effective" here. Since unlike the other
effective notes which are about turning on optimizations, this is
about turning them off.

Maybe the following is better:
```
-Wmaybe-uninitialized is known not to warn in many situations (false
negatives) due to some optimizations (like cpp, -ftree-ccp).
```

Thanks,
Andrew Pinski

>
>  gcc/doc/invoke.texi | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index f93fe43733dc..5b02d2deafe7 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -8337,6 +8337,8 @@ struct A @{
>  @};
>  @end smallexample
>
> +This option is more effective when @option{-fno-tree-ccp} is active.
> +
>  @opindex Winvalid-memory-model
>  @opindex Wno-invalid-memory-model
>  @item -Wno-invalid-memory-model
> --
> 2.51.0
>

Reply via email to