From 6acdd0fd75cae3f5a1af6c60b59a233102703b8d Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Sun, 18 Oct 1998 16:34:41 +0000 Subject: [PATCH] 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/ChangeLog | 5 +++++ gcc/function.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62a23cf21b3..30d0e09e7ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Oct 18 17:31:26 1998 Jeffrey A Law (law@cygnus.com) + + * function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL + if it has a nonzero DECL_INITIAL. + Sat Oct 17 23:18:08 1998 Kaveh R. Ghazi * Makefile.in (flow.o): Depend on recog.h. 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");