This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/69726] New: Bogus warnings with -O3 -Wuninitialized
- From: "jamrial at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Feb 2016 03:13:35 +0000
- Subject: [Bug tree-optimization/69726] New: Bogus warnings with -O3 -Wuninitialized
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69726
Bug ID: 69726
Summary: Bogus warnings with -O3 -Wuninitialized
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jamrial at gmail dot com
Target Milestone: ---
Created attachment 37636
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37636&action=edit
Test case
[jamrial@ArchVM ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/jamrial/gcc-svn/configure --prefix=/usr/local
--libdir=/usr/local/lib --libexecdir=/usr/local/lib
--mandir=/usr/local/share/man --infodir=/usr/local/share/info
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--enable-libmpx --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib
--disable-bootstrap --disable-werror
Thread model: posix
gcc version 6.0.0 20160207 (experimental) (GCC)
[jamrial@ArchVM ~]$ gcc -Wuninitialized -O3 -c bink_idct.c
bink_idct.c: In function âbink_idct_put_câ:
bink_idct.c:57:9: warning: â*((void *)&temp+224)â is used uninitialized in this
function [-Wuninitialized]
int temp[64];
^~~~
bink_idct.c:57:9: warning: â*((void *)&temp+192)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: â*((void *)&temp+160)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: â*((void *)&temp+128)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: â*((void *)&temp+96)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: â*((void *)&temp+64)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: â*((void *)&temp+32)â is used uninitialized in this
function [-Wuninitialized]
bink_idct.c:57:9: warning: âtempâ is used uninitialized in this function
[-Wuninitialized]
This doesn't happen with -fno-tree-vectorize or any optimization level below
-O3.
gcc 5.3 is unaffected.
ffmpeg's test suite makes use of all these functions as you can see here
http://coverage.ffmpeg.org/src/libavcodec/binkdsp.c.gcov.html and gcc 5.3 ubsan
is happy with it as seen here
http://fate.ffmpeg.org/report.cgi?time=20160209015611&slot=x86_64-archlinux-gcc-ubsan
so they are most certainly bogus.