[Bug c/58698] Spurious "may be used unitialized" warning when compiling with -Os

2013-10-11 Thread arequipeno at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

--- Comment #2 from Ian Pilcher  ---
Created attachment 30988
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30988&action=edit
Header file (required to compile C source)


[Bug c/58698] New: Spurious "may be used unitialized" warning when compiling with -Os

2013-10-11 Thread arequipeno at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

Bug ID: 58698
   Summary: Spurious "may be used unitialized" warning when
compiling with -Os
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: arequipeno at gmail dot com

When compiling the (soon to be) attached file with -Os, I receive the following
warning:

[pilcher@ian freecusd2]$ gcc -Os -W -Wall -Wextra -lpthread -c -o /dev/null
raid.c
raid.c: In function ‘fcd_raid_fn’:
raid.c:694:20: warning: ‘array’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
  array->ideal_devs = atoi(c + matches[4].rm_so);
^
raid.c:642:25: note: ‘array’ was declared here
  struct fcd_raid_array *array;
 ^

I don't get this warning with -O0, -O1, -O2, or -O3.

(array is initialized by the call to fcd_find_array at line 651; that function
can be found at line 371.)

This is gcc 4.8.1 on Fedora 19 (x86_64):

[pilcher@ian ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-isl=/builddir/build/BUILD/gcc-4.8.1-20130603/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.1-20130603/obj-x86_64-redhat-linux/cloog-install
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.1 20130603 (Red Hat 4.8.1-1) (GCC)

[Bug c/58698] Spurious "may be used unitialized" warning when compiling with -Os

2013-10-11 Thread arequipeno at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

--- Comment #1 from Ian Pilcher  ---
Created attachment 30987
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30987&action=edit
C source file


[Bug c/58698] Spurious "may be used unitialized" warning when compiling with -Os

2013-10-11 Thread arequipeno at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

--- Comment #3 from Ian Pilcher  ---
Created attachment 30989
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30989&action=edit
Preprocessed file


[Bug c/58698] Spurious "may be used unitialized" warning when compiling with -Os

2013-10-11 Thread arequipeno at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

--- Comment #4 from Ian Pilcher  ---
Created attachment 30990
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30990&action=edit
Assembler file