Re: invalid "may be used uninitialized" warning with g++ current

2009-02-04 Thread Дмитрий Дьяченко
Thanks, Sorry, but I don't understood - is it impossible to fix, so there are no needs in bug report? Or PR about this issue already exists? Or it's not a bug? Dmitry 2009/2/5 Andrew Pinski : > On Wed, Feb 4, 2009 at 1:18 PM, Дмитрий Дьяченко wrote: >> The following code >> >> int bar(int *gl

Re: invalid "may be used uninitialized" warning with g++ current

2009-02-04 Thread Andrew Pinski
On Wed, Feb 4, 2009 at 1:18 PM, Дмитрий Дьяченко wrote: > The following code > > int bar(int *global) > { >int local; >if(&local != global) >return 0; >return local; > } The issue is that GCC does not figure that global cannot point to local so it does not optimize away the if

invalid "may be used uninitialized" warning with g++ current

2009-02-04 Thread Дмитрий Дьяченко
The following code int bar(int *global) { int local; if(&local != global) return 0; return local; } compiled with gcc/x86/Linux version 4.4.0 20090204 (experimental) [trunk revision 143938] trigger warning: # g++ -Wall -O2 -c test4.cpp test4.cpp: In function 'int bar(int*)':