public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/56231] New: warning traces have bogus line information when using LTO
@ 2013-02-06 21:56 matt at use dot net
  2013-02-07 10:52 ` [Bug middle-end/56231] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: matt at use dot net @ 2013-02-06 21:56 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56231
           Summary: warning traces have bogus line information when using
                    LTO
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matt@use.net


>From bootstrapping GCC itself, one gets warnings that have bogus line entries,
like the ":61:" line below:
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:116:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c: In function 'elf_add':
../../gcc-trunk/libbacktrace/mmapio.c:98:14: error: 'ehdr_view.len' may be used
uninitialized in this function [-Werror=maybe-uninitialized]


On large LTO compilation units, the final link can include some of these kinds
of warnings that contain literally hundreds of ":0:" and ":N:" entries per
warning.

To reproduce the above issue, bootstrap trunk like so:
../gcc-trunk/configure --program-suffix=-4.8 --enable-languages=c,c++,lto
--prefix=/u/mhargett --with-build-config=bootstrap-lto --enable-lto
--with-fpmath=sse --disable-isl-version-check --disable-libmudflap
--disable-libssp --enable-gold=yes --disable-multilib --disable-nls
BOOT_CFLAGS="-O3 -floop-block -floop-interchange -floop-strip-mine
-march=nocona =mtune=core2" CFLAGS_FOR_BUILD="-O3 -floop-block
-floop-strip-mine -floop-interchange -march=nocona -mtune=core2"
CXXFLAGS_FOR_BUILD="-O3 -floop-block -floop-interchange -floop-strip-mine
-march=nocona -mtune=core2"

make

more complete output from the bootstrap that illustrates this bug:
/work/mhargett/gcc-trunk-obj/./prev-gcc/xg++
-B/work/mhargett/gcc-trunk-obj/./prev-gcc/
-B/u/mhargett/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/work/mhargett/gcc-trunk/libstdc++-v3/libsupc++
-L/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
  -g -O2 -O3 -march=nocona -mtune=core2 -floop-block -floop-interchange
-floop-strip-mine -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  gcov.o libcommon.a
../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -o gcov
/work/mhargett/gcc-trunk-obj/./prev-gcc/xg++
-B/work/mhargett/gcc-trunk-obj/./prev-gcc/
-B/u/mhargett/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/work/mhargett/gcc-trunk/libstdc++-v3/libsupc++
-L/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/work/mhargett/gcc-trunk-obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
  -g -O2 -O3 -march=nocona -mtune=core2 -floop-block -floop-interchange
-floop-strip-mine -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  gcov-dump.o \
        libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -o gcov-dump
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:116:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c: In function 'elf_add':
../../gcc-trunk/libbacktrace/mmapio.c:98:14: error: 'ehdr_view.len' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   if (munmap (const_cast.v, view->len) < 0)
              ^
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:119:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c:476:25: note: 'ehdr_view.len' was declared
here
   struct backtrace_view ehdr_view;
                         ^
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:116:0,
                 from :61:
../../gcc-trunk/libbacktrace/mmapio.c:98:14: error: 'ehdr_view.base' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
   if (munmap (const_cast.v, view->len) < 0)
              ^
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:119:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c:476:25: note: 'ehdr_view.base' was declared
here
   struct backtrace_view ehdr_view;
                         ^
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:119:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c:516:10: error: 'ehdr_view.data' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   memcpy (&ehdr, ehdr_view.data, sizeof ehdr);
          ^
In file included from ../../gcc-trunk/libbacktrace/mmapio.c:119:0,
                 from :61:
../../gcc-trunk/libbacktrace/elf.c:476:25: note: 'ehdr_view.data' was declared
here
   struct backtrace_view ehdr_view;
                         ^
lto1: all warnings being treated as errors
make[4]: *** [/tmp/ccPsAbnW.ltrans2.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]: *** [gcov-dump] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ../../gcc-trunk/libiberty/cp-demangle.c:877:0,
                 from :73:
../../gcc-trunk/libbacktrace/elf.c: In function 'backtrace_initialize':
../../gcc-trunk/libbacktrace/mmapio.c:98:14: error: 'ehdr_view.len' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   if (munmap (const_cast.v, view->len) < 0)
              ^
In file included from ../../gcc-trunk/libiberty/cp-demangle.c:879:0,
                 from :73:
../../gcc-trunk/libbacktrace/elf.c:476:25: note: 'ehdr_view.len' was declared
here
   struct backtrace_view ehdr_view;
                         ^
In file included from ../../gcc-trunk/libiberty/cp-demangle.c:877:0,
                 from :73:
../../gcc-trunk/libbacktrace/mmapio.c:98:14: error: 'ehdr_view.base' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
   if (munmap (const_cast.v, view->len) < 0)
              ^
In file included from ../../gcc-trunk/libiberty/cp-demangle.c:879:0,
                 from :73:
../../gcc-trunk/libbacktrace/elf.c:476:25: note: 'ehdr_view.base' was declared
here
   struct backtrace_view ehdr_view;
                         ^
In file included from ../../gcc-trunk/libiberty/cp-demangle.c:879:0,
                 from :73:
../../gcc-trunk/libbacktrace/elf.c:516:10: error: 'ehdr_view.data' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   memcpy (&ehdr, ehdr_view.data, sizeof ehdr);
          ^
lto1: all warnings being treated as errors
make[4]: *** [/tmp/ccQkv0KI.ltrans13.ltrans.o] Error 1


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

end of thread, other threads:[~2013-02-12 11:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 21:56 [Bug middle-end/56231] New: warning traces have bogus line information when using LTO matt at use dot net
2013-02-07 10:52 ` [Bug middle-end/56231] " rguenth at gcc dot gnu.org
2013-02-07 13:54 ` rguenth at gcc dot gnu.org
2013-02-07 14:02 ` rguenth at gcc dot gnu.org
2013-02-07 14:35 ` rguenth at gcc dot gnu.org
2013-02-07 19:10 ` manu at gcc dot gnu.org
2013-02-08  9:07 ` rguenther at suse dot de
2013-02-08 10:10 ` rguenth at gcc dot gnu.org
2013-02-08 10:55 ` rguenth at gcc dot gnu.org
2013-02-08 12:55 ` rguenth at gcc dot gnu.org
2013-02-08 12:56 ` rguenth at gcc dot gnu.org
2013-02-12  1:55 ` matt at use dot net
2013-02-12  2:02 ` matt at use dot net
2013-02-12 11:11 ` rguenther at suse dot de

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).