public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized
@ 2013-03-04 19:00 matt at use dot net
  2013-03-04 19:06 ` [Bug middle-end/56526] " matt at use dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: matt at use dot net @ 2013-03-04 19:00 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

             Bug #: 56526
           Summary: [4.8 regression] false positive for
                    maybe-uninitialized
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matt@use.net


I haven't tracked down when this started happening, but it's a regression from
fsf/4.7 and google/4.7, as well as trunk from some months ago.

/work/mhargett/gcc-trunk-lto-O3/./prev-gcc/xg++
-B/work/mhargett/gcc-trunk-lto-O3/./prev-gcc/
-B/u/mhargett/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/work/mhargett/gcc-trunk/libstdc++-v3/libsupc++
-L/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/work/mhargett/gcc-trunk-lto-O3/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
  -O3 -g -flto=jobserver -frandom-seed=1 -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common 
-DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  gcc-nm.o -o gcc-nm \
                file-find.o libcommon.a ../libcpp/libcpp.a  
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a
../../gcc-trunk/libiberty/simple-object-mach-o.c: In function
'simple_object_mach_o_find_sections':
../../gcc-trunk/libiberty/simple-object-mach-o.c:653:37: error:
'wrapper_sect_offset' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
     secoffset = wrapper_sect_offset + subsect_offset;
                                     ^
lto1: all warnings being treated as errors
make[4]: *** [/tmp/ccGVpjK3.ltrans21.ltrans.o] Error 1
../../gcc-trunk/libiberty/simple-object-mach-o.c: In function
'simple_object_mach_o_find_sections':
../../gcc-trunk/libiberty/simple-object-mach-o.c:653:37: error:
'wrapper_sect_offset' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
     secoffset = wrapper_sect_offset + subsect_offset;
                                     ^
lto1: all warnings being treated as errors
make[4]: *** [/tmp/ccGVpjK3.ltrans21.ltrans.o] Error 1
lto-wrapper: make returned 2 exit status
/u/mhargett/x86_64-unknown-linux-gnu/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [lto-wrapper] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f Tcollect2 collect2
make[3]: Leaving directory `/work/mhargett/gcc-trunk-lto-O3/gcc'
make[2]: *** [all-stage2-gcc] Error 2

wrapper_sect_offset is initialized in the block predicated by
((gnu_sections_found & SOMO_WRAPPING) != 0), and is only accessed in a block
with the same (outer) predicate.

reproduced with bootstrap-lto on current trunk with -O3. save-temp outputs are
attached.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
@ 2013-03-04 19:06 ` matt at use dot net
  2013-03-05 10:23 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: matt at use dot net @ 2013-03-04 19:06 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

--- Comment #1 from Matt Hargett <matt at use dot net> 2013-03-04 19:04:58 UTC ---
Created attachment 29580
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29580
save-temps output from same commandline/path


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
  2013-03-04 19:06 ` [Bug middle-end/56526] " matt at use dot net
@ 2013-03-05 10:23 ` rguenth at gcc dot gnu.org
  2013-03-05 15:17 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-05 10:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Target Milestone|---                         |4.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
  2013-03-04 19:06 ` [Bug middle-end/56526] " matt at use dot net
  2013-03-05 10:23 ` rguenth at gcc dot gnu.org
@ 2013-03-05 15:17 ` jakub at gcc dot gnu.org
  2013-03-05 15:23 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-05 15:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-05 15:16:59 UTC ---
Author: jakub
Date: Tue Mar  5 15:16:49 2013
New Revision: 196466

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196466
Log:
    PR middle-end/56526
    * simple-object-mach-o.c (simple_object_mach_o_segment): Initialize
    wrapper_sect_offset to avoid a warning.

Modified:
    trunk/libiberty/ChangeLog
    trunk/libiberty/simple-object-mach-o.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
                   ` (2 preceding siblings ...)
  2013-03-05 15:17 ` jakub at gcc dot gnu.org
@ 2013-03-05 15:23 ` jakub at gcc dot gnu.org
  2013-03-06  2:06 ` matt at use dot net
  2013-03-06  7:03 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-05 15:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-05 15:22:39 UTC ---
Should be fixed hopefully.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
                   ` (3 preceding siblings ...)
  2013-03-05 15:23 ` jakub at gcc dot gnu.org
@ 2013-03-06  2:06 ` matt at use dot net
  2013-03-06  7:03 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: matt at use dot net @ 2013-03-06  2:06 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

--- Comment #4 from Matt Hargett <matt at use dot net> 2013-03-06 02:06:03 UTC ---
It does fix that warning, but there's a bug in the analysis that makes it a
false positive. I've had difficulty reducing it to a self-contained example,
and I don't have the expertise to do more in-depth debugging.

This should stay open until the analysis is done to show that it's an accepted
limitation of the warning's capabilities, IMO.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/56526] [4.8 regression] false positive for maybe-uninitialized
  2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
                   ` (4 preceding siblings ...)
  2013-03-06  2:06 ` matt at use dot net
@ 2013-03-06  7:03 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-06  7:03 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56526

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-06 07:03:23 UTC ---
Maybe-uninitialized warnings have tons of known false positives, while the
predicated analysis can handle the simplest cases, it can't handle anything
more complicated.  As this isn't a usable testcase, requires LTO to reproduce,
I don't think it is worth keeping it open.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-06  7:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 19:00 [Bug middle-end/56526] New: [4.8 regression] false positive for maybe-uninitialized matt at use dot net
2013-03-04 19:06 ` [Bug middle-end/56526] " matt at use dot net
2013-03-05 10:23 ` rguenth at gcc dot gnu.org
2013-03-05 15:17 ` jakub at gcc dot gnu.org
2013-03-05 15:23 ` jakub at gcc dot gnu.org
2013-03-06  2:06 ` matt at use dot net
2013-03-06  7:03 ` jakub at gcc dot gnu.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).