diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-29 14:07:44 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-29 14:07:44 +0000 |
commit | 49bf95f0a8bbc31f352ebbeca580f2ac23917fe7 (patch) | |
tree | 357716b9392e3994c718f459d97bc805a5894b34 | |
parent | 4dfdb7fdfea1f64d01cb55b18cc10753384dbe6b (diff) | |
download | ppe42-gcc-49bf95f0a8bbc31f352ebbeca580f2ac23917fe7.tar.gz ppe42-gcc-49bf95f0a8bbc31f352ebbeca580f2ac23917fe7.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78648 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wunused-6.C | 11 |
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56158b56b18..dae31a0922e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/function.c b/gcc/function.c index 84f0e853d7e..623f78cc4cd 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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'", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a5dd16bfbef..1b768d02733 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..58a3f642bc3 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-6.C @@ -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" "" } +} + |