This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]