summaryrefslogtreecommitdiffstats
path: root/gcc/function.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-18 16:34:41 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-18 16:34:41 +0000
commit09d4d14ea0f9258e186f1c8d0c19ee6eb8788ecc (patch)
treee414ee2f7817e53cd035404e67a562a70c276dec /gcc/function.c
parentcbf0a8cc232ac278a84e97a2e3cf0e9bbce37f93 (diff)
downloadppe42-gcc-09d4d14ea0f9258e186f1c8d0c19ee6eb8788ecc.tar.gz
ppe42-gcc-09d4d14ea0f9258e186f1c8d0c19ee6eb8788ecc.zip
* function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL
if it has a nonzero DECL_INITIAL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c
index e594e7000f5..148acc0e4fb 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4907,6 +4907,14 @@ uninitialized_vars_warning (block)
&& ! AGGREGATE_TYPE_P (TREE_TYPE (decl))
&& DECL_RTL (decl) != 0
&& GET_CODE (DECL_RTL (decl)) == REG
+ /* Global optimizations can make it difficult to determine if a
+ particular variable has been initialized. However, a VAR_DECL
+ with a nonzero DECL_INITIAL had an initializer, so do not
+ claim it is potentially uninitialized.
+
+ We do not care about the actual value in DECL_INITIAL, so we do
+ not worry that it may be a dangling pointer. */
+ && DECL_INITIAL (decl) == NULL_TREE
&& regno_uninitialized (REGNO (DECL_RTL (decl))))
warning_with_decl (decl,
"`%s' might be used uninitialized in this function");
OpenPOWER on IntegriCloud