On Tue, Oct 7, 2025 at 4:22 AM Sam James <[email protected]> wrote:
>
> Sandra Loosemore <[email protected]> writes:
>
> > On 10/6/25 19:03, Andrew Pinski wrote:
> >> 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).
> >> ```
> >
> > Yeah, my initial reaction was that "more effective" didn't really
> > explain what the problem was.  I think it would be better to phrase
> > this more directly in the active voice, something like
>
> I admit I chose somewhat "stub phrasing" because I wanted to see if
> people were OK with the idea of "docs accommodating known, long-term
> bugs" ;)

Anything that doesn't suggest people should use -fno-tree-ccp to get
better warnings is OK.  In this respect I would even change it to

'
-Wmaybe-uninitialized is known not to warn in many situations (false
negatives) due to optimizations taking advantage of undefinedness
of uninitialized uses like constant propagation.
'

Richard.

>
> >
> > Some optimizations interfere with @option{-Wmaybe-uninitialized} and
> > may cause false negatives.  In particular, disabling the conditional
> > constant propagation pass with @option{-fno-tree-ccp} gives more
> > accurate diagnostics.
>
> I like that.
>
> >
> > ??
> >
> > -Sandra

Reply via email to