public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44781] New: unjustified warning about uinitialized variable
@ 2010-07-02 10:31 cwg at falma dot de
2010-07-02 10:33 ` [Bug c++/44781] " cwg at falma dot de
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: cwg at falma dot de @ 2010-07-02 10:31 UTC (permalink / raw)
To: gcc-bugs
when compiling the attached program with
g++ -g -Wall -Wextra -O2 test.cc
I get the following output:
test.cc: In function 'Tiny_vector<double, D> foo() [with int D = 1]':
test.cc:67:28: warning: 'point.Tiny_vector<double, 1>::x[i.2]' may be used
uninitialized in this function [-Wuninitialized]
However, the warning about an uninitialized variable seems to be unjustified.
This bug also occurs with g++ 4.4.4. Then
cwg@argo:~$ g++-snapshot -v -save-temps -g -Wall -Wextra -O2 test.cc
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 20100621-1'
--with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,java,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --disable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-gold --with-plugin-ld=ld.gold --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.6-snap/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.6-snap
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.6-snap
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --with-arch-32=i486 --with-tune=generic --disable-werror
--enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.0 20100621 (experimental) [trunk revision 161065] (Debian
20100621-1)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-O2'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/cc1plus -E -quiet -v
-D_GNU_SOURCE test.cc -mtune=generic -march=x86-64 -Wall -Wextra -g
-fworking-directory -O2 -fpch-preprocess -o test.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/home/cwg/include
/home/cwg/il/include
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/x86_64-linux-gnu
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
/usr/local/include
/usr/lib/gcc-snapshot/include
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/include
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/include-fixed
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-O2'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.cc -mtune=generic -march=x86-64
-auxbase test -g -O2 -Wall -Wextra -version -o test.s
GNU C++ (Debian 20100621-1) version 4.6.0 20100621 (experimental) [trunk
revision 161065] (x86_64-linux-gnu)
compiled by GNU C version 4.6.0 20100621 (experimental) [trunk revision
161065], GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (Debian 20100621-1) version 4.6.0 20100621 (experimental) [trunk
revision 161065] (x86_64-linux-gnu)
compiled by GNU C version 4.6.0 20100621 (experimental) [trunk revision
161065], GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 0636e4414ce9f58acfa5abe5245be350
test.cc: In function 'Tiny_vector<double, D> foo() [with int D = 1]':
test.cc:67:28: warning: 'point.Tiny_vector<double, 1>::x[i.2]' may be used
uninitialized in this function [-Wuninitialized]
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-O2'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
as -V -Qy --64 -o test.o test.s
GNU assembler version 2.20.1 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Debian) 2.20.1-system.20100303
COMPILER_PATH=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/:/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/:/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/:/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/home/cwg/lib/../lib/:/home/cwg/il/lib/../lib/:/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/:/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/home/cwg/lib/:/home/cwg/il/lib/:/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-O2'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/collect2 --build-id
--no-add-needed --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 /usr/lib/../lib/crt1.o /usr/lib/../lib/crti.o
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/crtbegin.o
-L/home/cwg/lib/../lib -L/home/cwg/il/lib/../lib
-L/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0
-L/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../lib
-L/lib/../lib -L/usr/lib/../lib -L/home/cwg/lib -L/home/cwg/il/lib
-L/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/../../.. test.o -lstdc++
-lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.6.0/crtend.o
/usr/lib/../lib/crtn.o
--
Summary: unjustified warning about uinitialized variable
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cwg at falma dot de
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44781
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/44781] unjustified warning about uinitialized variable
2010-07-02 10:31 [Bug c++/44781] New: unjustified warning about uinitialized variable cwg at falma dot de
@ 2010-07-02 10:33 ` cwg at falma dot de
2010-07-02 10:34 ` cwg at falma dot de
2010-07-05 1:27 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: cwg at falma dot de @ 2010-07-02 10:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from cwg at falma dot de 2010-07-02 10:33 -------
Created an attachment (id=21064)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21064&action=view)
preprocessed file which triggers the bug
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44781
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/44781] unjustified warning about uinitialized variable
2010-07-02 10:31 [Bug c++/44781] New: unjustified warning about uinitialized variable cwg at falma dot de
2010-07-02 10:33 ` [Bug c++/44781] " cwg at falma dot de
@ 2010-07-02 10:34 ` cwg at falma dot de
2010-07-05 1:27 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: cwg at falma dot de @ 2010-07-02 10:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from cwg at falma dot de 2010-07-02 10:34 -------
Created an attachment (id=21065)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21065&action=view)
unpreprocessed source which triggers the bug
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44781
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/44781] unjustified warning about uinitialized variable
2010-07-02 10:31 [Bug c++/44781] New: unjustified warning about uinitialized variable cwg at falma dot de
2010-07-02 10:33 ` [Bug c++/44781] " cwg at falma dot de
2010-07-02 10:34 ` cwg at falma dot de
@ 2010-07-05 1:27 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-05 1:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2010-07-05 01:26 -------
Does not warn with:
GNU C++ (GCC) version 4.6.0 20100627 (experimental) [trunk revision 161476]
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20100627 (experimental) [trunk revision
161476], GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
Though we could have the same issue:
<bb 4>:
# i_29 = PHI <1(3), 0(6)>
# point$x$_18 = PHI <point$x$_8(3), point$x$_17(6)>
<bb 5>:
# i_1 = PHI <i_29(4), 0(2)>
# point$x$_17 = PHI <point$x$_18(4), point$x$_3(D)(2)>
Why aren't those two BB's combined?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44781
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-05 1:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-02 10:31 [Bug c++/44781] New: unjustified warning about uinitialized variable cwg at falma dot de
2010-07-02 10:33 ` [Bug c++/44781] " cwg at falma dot de
2010-07-02 10:34 ` cwg at falma dot de
2010-07-05 1:27 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).