aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/c-c++-common/uninit-17.c4
-rw-r--r--gcc/tree-ssa.c2
4 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12aa9e3..4b70451 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-21 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR middle-end/44738
+ * tree-ssa.c (warn_uninit): Avoid emitting an unnecessary message.
+
2010-07-21 Richard Guenther <rguenther@suse.de>
PR middle-end/45013
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3cac7383..56aba5f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-21 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR middle-end/44738
+ * c-c++-common/uninit-17.c: Correct expected error.
+
2010-07-21 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/guality/asm-1.c: New test.
diff --git a/gcc/testsuite/c-c++-common/uninit-17.c b/gcc/testsuite/c-c++-common/uninit-17.c
index b895ac7..6282962 100644
--- a/gcc/testsuite/c-c++-common/uninit-17.c
+++ b/gcc/testsuite/c-c++-common/uninit-17.c
@@ -9,9 +9,9 @@ static void bar(int a, int *ptr)
{
do
{
- int b; /* { dg-message "note: 'b' was declared here" } */
+ int b; /* { dg-warning "is used uninitialized" } */
if (b < 40) {
- ptr[0] = b; /* { dg-warning "may be used uninitialized" } */
+ ptr[0] = b;
}
b += 1;
ptr++;
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index ba28c64..c31b0d1 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1632,6 +1632,8 @@ warn_uninit (tree t, const char *gmsgid, void *data)
{
TREE_NO_WARNING (var) = 1;
+ if (location == DECL_SOURCE_LOCATION (var))
+ return;
if (xloc.file != floc.file
|| xloc.line < floc.line
|| xloc.line > LOCATION_LINE (cfun->function_end_locus))