]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorRoger Sayle <sayle@gcc.gnu.org>
Sun, 29 Feb 2004 14:07:44 +0000 (14:07 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 29 Feb 2004 14:07:44 +0000 (14:07 +0000)
2004-02-29  Waldek Hebisch  <hebisch@math.uni.wroc.pl>

PR middle-end/14203
* function.c (uninitialized_vars_warning): Use DECL_RTL_SET_P
instead of testing whether DECL_RTL is not NULL.

2004-02-29  Roger Sayle  <roger@eyesopen.com>

PR middle-end/14203
* g++.dg/warn/Wunused-6.C: New test case.

From-SVN: r78648

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wunused-6.C [new file with mode: 0644]

index 56158b56b18493cb0059a0601fa64f7c71692eea..dae31a0922e3d5af5821882b0c8ac15756da19d7 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-29  Waldek Hebisch  <hebisch@math.uni.wroc.pl>
+
+       PR middle-end/14203
+       * function.c (uninitialized_vars_warning): Use DECL_RTL_SET_P
+       instead of testing whether DECL_RTL is not NULL.
+
 2004-02-28  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/sh/sh.c: Fix formatting.
index 84f0e853d7e564e85f748d04c98da61c52fddabe..623f78cc4cd54531a44490b5035b4aeaf64d71f5 100644 (file)
@@ -5702,7 +5702,7 @@ uninitialized_vars_warning (tree block)
             flow.c that the entire aggregate was initialized.
             Unions are troublesome because members may be shorter.  */
          && ! AGGREGATE_TYPE_P (TREE_TYPE (decl))
-         && DECL_RTL (decl) != 0
+         && DECL_RTL_SET_P (decl)
          && 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
@@ -5717,7 +5717,7 @@ uninitialized_vars_warning (tree block)
                 decl, decl);
       if (extra_warnings
          && TREE_CODE (decl) == VAR_DECL
-         && DECL_RTL (decl) != 0
+         && DECL_RTL_SET_P (decl)
          && GET_CODE (DECL_RTL (decl)) == REG
          && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
        warning ("%Jvariable '%D' might be clobbered by `longjmp' or `vfork'",
index a5dd16bfbef7773b426fb378f2dbd01d0cffdd36..1b768d0273318d41b399aadbd7d317f81895471d 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-29  Roger Sayle  <roger@eyesopen.com>
+
+       PR middle-end/14203
+       * g++.dg/warn/Wunused-6.C: New test case.
+
 2004-02-28  Richard Earnshaw  <rearnsha@arm.com>
 
        * lib/g++.exp (g++_link_flags): Don't crash if LD_LIBRARY_PATH is
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-6.C b/gcc/testsuite/g++.dg/warn/Wunused-6.C
new file mode 100644 (file)
index 0000000..58a3f64
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR middle-end/14203 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void foo()
+{
+  if (false)
+    if (int i=0)  // { dg-warning "unused" "" }
+      int j=0;    // { dg-warning "unused" "" }
+}
+
This page took 0.186667 seconds and 5 git commands to generate.