Patchwork Fix uninit-17.c (PR44738)

login
register
mail settings
Submitter Bernd Schmidt
Date July 14, 2010, 10:54 a.m.
Message ID <4C3D9782.1010801@t-online.de>
Download mbox | patch
Permalink /patch/58863/
State New
Headers show

Comments

Bernd Schmidt - July 14, 2010, 10:54 a.m.
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.
Bernd Schmidt - July 19, 2010, 12:50 p.m.
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 Guenther - July 19, 2010, 12:54 p.m.
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.
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 Guenther - July 19, 2010, 12:59 p.m.
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.
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.

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))