public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "arequipeno at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58698] New: Spurious "may be used unitialized" warning when compiling with -Os
Date: Sat, 12 Oct 2013 03:09:00 -0000	[thread overview]
Message-ID: <bug-58698-4@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4413 bytes --]

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)
>From gcc-bugs-return-431516-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 12 03:09:46 2013
Return-Path: <gcc-bugs-return-431516-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25026 invoked by alias); 12 Oct 2013 03:09:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24999 invoked by uid 48); 12 Oct 2013 03:09:43 -0000
From: "arequipeno at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58698] Spurious "may be used unitialized" warning when compiling with -Os
Date: Sat, 12 Oct 2013 03:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: arequipeno at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-58698-4-y6OCQ7T3DD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58698-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58698-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg00660.txt.bz2
Content-length: 227

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX698

--- Comment #1 from Ian Pilcher <arequipeno at gmail dot com> ---
Created attachment 30987
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0987&actioníit
C source file


             reply	other threads:[~2013-10-12  3:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  3:09 arequipeno at gmail dot com [this message]
2013-10-12  3:10 ` [Bug c/58698] " arequipeno at gmail dot com
2013-10-12  3:11 ` arequipeno at gmail dot com
2013-10-12  3:13 ` arequipeno at gmail dot com
2013-10-12 19:50 ` [Bug tree-optimization/58698] " pinskia at gcc dot gnu.org
2013-10-14  9:05 ` [Bug tree-optimization/58698] [4.7/4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-10-14 16:50 ` law at redhat dot com
2013-11-05 15:00 ` rguenth at gcc dot gnu.org
2013-11-19 22:18 ` law at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58698-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).