function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL if it has a nonze...
authorJeffrey A Law <law@cygnus.com>
Sun, 18 Oct 1998 16:34:41 +0000 (16:34 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 18 Oct 1998 16:34:41 +0000 (10:34 -0600)
        * function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL
        if it has a nonzero DECL_INITIAL.

From-SVN: r23164

gcc/ChangeLog
gcc/function.c

index 62a23cf21b399e7ada86b503ec012f171b051f57..30d0e09e7ce80dd613584d0fd19e1bcb91ffea34 100644 (file)
@@ -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  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (flow.o): Depend on recog.h.
index e594e7000f58d7b87688383de6a405786821f4e0..148acc0e4fbb7c451ceafbb5995e0074fb133d99 100644 (file)
@@ -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");