From 6acdd0fd75cae3f5a1af6c60b59a233102703b8d Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Sun, 18 Oct 1998 16:34:41 +0000 Subject: function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL if it has a nonzero DECL_INITIAL. * function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL if it has a nonzero DECL_INITIAL. From-SVN: r23164 --- gcc/function.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/function.c') 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"); -- cgit v1.2.3