[Bug c/57407] New: Missing uninitialized warning following assert

2013-05-24 Thread stuff0003 at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57407

Bug ID: 57407
   Summary: Missing uninitialized warning following assert
   Product: gcc
   Version: 4.6.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: stuff0003 at pobox dot com

In certain circumstances following an assertion, there is no warning for an
uninitialised variable.
(keyword also: uninitialized)

$ cat nowarn.c
#include 
#include 
int main(int ac,char**av){
  int e,f;
  f=1;assert(f);
  printf("%d\n",e);
  return 0;
}
$ gcc -c nowarn.c -Wall -O3
$
(no warning generated)

Note that without optimisation you get the expected result:

$ gcc -c nowarn.c -Wall
nowarn.c: In function ‘main’:
nowarn.c:6:9: warning: ‘e’ may be used uninitialised in this function
[-Wuninitialized]

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
...

You also get the expected result if assert(f) is replace by assert(1).

[Bug tree-optimization/57407] Missing uninitialized warning following assert

2013-05-24 Thread stuff0003 at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57407

--- Comment #2 from Alex  ---
I'm very sorry, I don't have the means to do that test easily.


[Bug tree-optimization/57407] Missing uninitialized warning following assert

2013-05-27 Thread stuff0003 at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57407

--- Comment #4 from Alex  ---
That's curious. It certainly doesn't work for me.

I wonder if it's possible that there is something wrong with subversion 4.6.3
(as opposed to version 4.6 tried above), or if Ubuntu/Linaro have somehow
introduced the problem when they ported it.

In any case, I'll take Andrew Pinski's suggestion and report it to Ubuntu. It
doesn't work for their current stable release, 12.04.