aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/invoke.texi
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-12-13 14:24:02 +0100
committerRichard Biener <rguenther@suse.de>2022-12-13 14:36:02 +0100
commit8f4634fb82d5670183d0ee42de9dae3b55ab5087 (patch)
tree6cbcf2f4ba649ad9d793c0a08d5f590951fe74f1 /gcc/doc/invoke.texi
parentedc676cfe8988c62c81b0df224c7fe82583012b1 (diff)
tree-optimization/105801 - CCP and .DEFERRED_INIT
This makes sure we treat .DEFERRED_INIT as producing UNDEFINED so we can continue optimizing uninitialized uses the same as without -ftrivial-auto-var-init=zero. For the testcase this means we catch the return 1 optimization opportunity at CCP rather than only at FRE which already does the right thing here. PR tree-optimization/105801 * tree-ssa-ccp.cc (likely_value): .DEFERRED_INIT produces UNDEFINED. * doc/invoke.texi (ftrivial-auto-var-init): Explicitely mention we treat variables without an initializer as undefined also for optimization purposes. * gcc.dg/tree-ssa/ssa-ccp-43.c: New testcase.
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r--gcc/doc/invoke.texi3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index cb40b38b73a..13371972fd1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -13208,7 +13208,8 @@ disclosure and use.
GCC still considers an automatic variable that doesn't have an explicit
initializer as uninitialized, @option{-Wuninitialized} and
@option{-Wanalyzer-use-of-uninitialized-value} will still report
-warning messages on such automatic variables.
+warning messages on such automatic variables and the compiler will
+perform optimization as if the variable were uninitialized.
With this option, GCC will also initialize any padding of automatic variables
that have structure or union types to zeroes.
However, the current implementation cannot initialize automatic variables that