]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/44738 (c-c++-common/uninit-17.c failed)
authorBernd Schmidt <bernds@codesourcery.com>
Wed, 21 Jul 2010 12:36:44 +0000 (12:36 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Wed, 21 Jul 2010 12:36:44 +0000 (12:36 +0000)
PR middle-end/44738
* tree-ssa.c (warn_uninit): Avoid emitting an unnecessary message.

PR middle-end/44738
* c-c++-common/uninit-17.c: Correct expected error.

From-SVN: r162372

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/uninit-17.c
gcc/tree-ssa.c

index 12aa9e3ad018fe203f5701951f18162375a6b75c..4b7045179b4d2f5de180e6f088f04b7fe1397ffb 100644 (file)
@@ -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
index 3cac73836592ea5ac33c1149d80f207977da3b77..56aba5fd6ebacf4105cdd62d2d5314910543f7f2 100644 (file)
@@ -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.
index b895ac7dcd9cc3c3c911c88bc3c820e4fe448ddd..628296213d584d601f0e9fa32f13045ce78553dc 100644 (file)
@@ -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++;
index ba28c64fc83b7bfdd09bcca3bb98b491f80a70f6..c31b0d1ce082a7cbe3d08d4bb742716d78df5df8 100644 (file)
@@ -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))