]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
doc: mention -Wmaybe-uninitialized vs CCP
authorSam James <sam@gentoo.org>
Tue, 7 Oct 2025 00:51:55 +0000 (01:51 +0100)
committerSam James <sam@gentoo.org>
Thu, 9 Oct 2025 03:11:37 +0000 (04:11 +0100)
CCP interacts poorly with -Wmaybe-uninitialized 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 (-Wmaybe-uninitialized): Mention interaction with
CCP.

gcc/doc/invoke.texi

index f93fe43733dc5bfe437af98501c8dba15f85d523..8802d416b30c7bb088d522034d7aa643682c41d7 100644 (file)
@@ -8375,7 +8375,10 @@ known to read the object.)  Annotating the function with attribute
 the object and avoids the warning (@pxref{Common Function Attributes}).
 
 These warnings are only possible in optimizing compilation, because otherwise
-GCC does not keep track of the state of variables.
+GCC does not keep track of the state of variables.  On the other hand,
+@option{-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.
 
 These warnings are made optional because GCC may not be able to determine when
 the code is correct in spite of appearing to have an error.  Here is one