diff mbox

Fix uninit-17.c (PR44738)

Message ID 4C3D9782.1010801@t-online.de
State New
Headers show

Commit Message

Bernd Schmidt July 14, 2010, 10:54 a.m. UTC
Whatever was causing this testcase to behave differently on i686 than on
all other targets seems to have been fixed.  There remains the problem
that we're emitting an unnecessary message, which I think can be fixed
with the change in warn_uninit.

Testing in progress (will test i686 and x86_64).  Ok?


Bernd
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.

Comments

Bernd Schmidt July 19, 2010, 12:50 p.m. UTC | #1
On 07/14/2010 12:54 PM, Bernd Schmidt wrote:
> 	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.

Ping.


Bernd
Richard Biener July 19, 2010, 12:54 p.m. UTC | #2
On Mon, Jul 19, 2010 at 2:50 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 07/14/2010 12:54 PM, Bernd Schmidt wrote:
>>       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.
>
> Ping.

Ok. (btw, your threading does not work - I had to lookup the original
patch in the archives.  Please make sure pings are replies to your
original message)

Thanks,
Richard.

>
> Bernd
>
Bernd Schmidt July 19, 2010, 12:55 p.m. UTC | #3
On 07/19/2010 02:54 PM, Richard Guenther wrote:
> On Mon, Jul 19, 2010 at 2:50 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>> On 07/14/2010 12:54 PM, Bernd Schmidt wrote:
>>>       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.
>>
>> Ping.
> 
> Ok. (btw, your threading does not work - I had to lookup the original
> patch in the archives.  Please make sure pings are replies to your
> original message)

It was.  Any other known reason why this would get messed up?  Have you
seen this for other pings from me?


Bernd
Richard Biener July 19, 2010, 12:59 p.m. UTC | #4
On Mon, Jul 19, 2010 at 2:55 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 07/19/2010 02:54 PM, Richard Guenther wrote:
>> On Mon, Jul 19, 2010 at 2:50 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>>> On 07/14/2010 12:54 PM, Bernd Schmidt wrote:
>>>>       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.
>>>
>>> Ping.
>>
>> Ok. (btw, your threading does not work - I had to lookup the original
>> patch in the archives.  Please make sure pings are replies to your
>> original message)
>
> It was.  Any other known reason why this would get messed up?  Have you
> seen this for other pings from me?

I don't remember but will watch now.  Maybe it is Google Mail that is
basing threading purely on the subject (and so is confused by your
Ping: prefix) instead of message-ids.

Richard.

>
> Bernd
>
Diego Novillo July 19, 2010, 1:03 p.m. UTC | #5
On 10-07-19 08:59 , Richard Guenther wrote:
> On Mon, Jul 19, 2010 at 2:55 PM, Bernd Schmidt<bernds@codesourcery.com>  wrote:
>>
>> It was.  Any other known reason why this would get messed up?  Have you
>> seen this for other pings from me?
>
> I don't remember but will watch now.  Maybe it is Google Mail that is
> basing threading purely on the subject (and so is confused by your
> Ping: prefix) instead of message-ids.

That's likely, gmail will do that.  It threads by subject, instead of 
message-id.


Diego.
diff mbox

Patch

Index: testsuite/c-c++-common/uninit-17.c
===================================================================
--- testsuite/c-c++-common/uninit-17.c	(revision 162146)
+++ testsuite/c-c++-common/uninit-17.c	(working copy)
@@ -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: tree-ssa.c
===================================================================
--- tree-ssa.c	(revision 162146)
+++ tree-ssa.c	(working copy)
@@ -1631,6 +1631,8 @@  warn_uninit (tree t, const char *gmsgid,
     {
       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))