User account creation filtered due to spam.

Bug 55496 - False positive -Werror=uninitialized breaks profiledbootstrap and bootstrap-lto
Summary: False positive -Werror=uninitialized breaks profiledbootstrap and bootstrap-lto
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, diagnostic
Depends on:
Blocks:
 
Reported: 2012-11-27 21:27 UTC by H.J. Lu
Modified: 2017-04-19 02:29 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-11-27 21:27:39 UTC
On Linux/x86-64, revision 193864 configured with

--prefix=/usr/4.8.0 --enable-clocale=gnu --with-system-zlib --enable-shared --with-demangler-in-ld --with-build-config=bootstrap-lto --with-fpmath=sse --enable-languages=c,c++,fortran,java,lto,objc

and built with

make bld profiledbootstrap -j 8

on a 8-core machine gave

/export/gnu/import/git/gcc-test-profile/bld/./prev-gcc/g++ -B/export/gnu/import/git/gcc-test-profile/bld/./prev-gcc/ -B/usr/4.8.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profile/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profile/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -c   -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -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 -I. -I. -I../../src-trunk/gcc -I../../src-trunk/gcc/. -I../../src-trunk/gcc/../include -I../../src-trunk/gcc/../libcpp/include  -I../../src-trunk/gcc/../libdecnumber -I../../src-trunk/gcc/../libdecnumber/bid -I../libdecnumber -I../../src-trunk/gcc/../libbacktrace    ../../src-trunk/gcc/cfg.c -o cfg.o
../../src-trunk/gcc/cfg.c: In function 'scale_bbs_frequencies_gcov_type(basic_block_def**, int, long, long)':
../../src-trunk/gcc/cfg.c:945:8: error: 'e' may be used uninitialized in this function [-Werror=uninitialized]
   edge e;
cc1plus: all warnings being treated as errors
make[6]: *** [cfg.o] Error 1
make[6]: *** Waiting for unfinished jobs....
rm gcj-dbtool.pod jcf-dump.pod jv-convert.pod grmic.pod gcov.pod gcj.pod gc-analyze.pod gfdl.pod cpp.pod gij.pod gfortran.pod gcc.pod fsf-funding.pod
make[6]: Leaving directory `/export/gnu/import/git/gcc-test-profile/bld/gcc'
make[5]: *** [all-stagefeedback-gcc] Error 2
make[5]: Leaving directory `/export/gnu/import/git/gcc-test-profile/bld'
make[4]: *** [stagefeedback-bubble] Error 2
make[4]: Leaving directory `/export/gnu/import/git/gcc-test-profile/bld'
make[3]: *** [profiledbootstrap] Error 2
make[3]: Leaving directory `/export/gnu/import/git/gcc-test-profile/bld'
11063.14user 498.20system 41:50.07elapsed 460%CPU (0avgtext+0avgdata 521396maxresident)k
55104inputs+14523280outputs (2major+111666564minor)pagefaults 0swaps
make[2]: *** [profiledbootstrap] Error 2
Comment 1 Matt Hargett 2013-02-13 02:08:02 UTC
Confirmed on current trunk, verified that it's not an issue in google/4_7 branch. Only happens with profiledbootstrap and bootstrap-lto. 

/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/./prev-gcc/xg++ -B/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/./prev-gcc/ -B/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/gcc-trunk-r195990/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/libstdc++-v3/libsupc++ -L/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/var/lib/jenkins/jobs/gcc-trunk-lto-profiledbootstrap/workspace/obj/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -c   -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -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 -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace    ../../gcc/cfg.c -o cfg.o
../../gcc/cfg.c: In function 'scale_bbs_frequencies_gcov_type(basic_block_def**, int, long, long)':
../../gcc/cfg.c:943:8: error: 'e' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   edge e;
        ^
cc1plus: all warnings being treated as errors
make[3]: *** [cfg.o] Error 1
Comment 2 Manuel López-Ibáñez 2016-08-23 16:15:27 UTC
Without a reduced testcase, it is impossible to know what the problem is.
Comment 3 Andrew Pinski 2016-10-22 07:50:18 UTC
Does this still happen?
Comment 4 Martin Sebor 2017-04-19 02:29:21 UTC
There are a ton of warnings in profiledbootstrap, including -Wuninitialized (see the full list below for an x86_64 GCC 7.0 configured with --enable-languages=ada,all,c,c++,fortran,go,objc,obj-c++ -with-build-config=bootstrap-lto --disable-werror).  My understanding is that it's not really expected to work without --disable-werror.

Diagnostic                        Count   Unique    Files
-Wmaybe-uninitialized               315       97       46
-Wuninitialized                      44       22        1
-Walloc-size-larger-than=            34        6        2
-Wlto-type-mismatch                  25       20        6
-Wunused-parameter                   20        3        2
-Wstringop-overflow=                 10        1        1
-Wnonnull                            10        4        2
-Wimplicit-fallthrough=               8        1        1
-Wsign-compare                        6        1        1
-Wcpp                                 4        1        1
-Wformat-truncation=                  3        2        1

-Walloc-size-larger-than Instances: 
  /src/gcc/trunk/gcc/dominance.c:153
  /src/gcc/trunk/gcc/dominance.c:167
  /src/gcc/trunk/gcc/dominance.c:168
  /src/gcc/trunk/gcc/dominance.c:169
  /src/gcc/trunk/gcc/dominance.c:303
  /src/gcc/trunk/gcc/go/go-gcc.cc:1896

-Wcpp Instances: 
  /usr/include/features.h:148

-Wformat-truncation Instances: 
  /src/gcc/trunk/libgfortran/intrinsics/date_and_time.c:168
  /src/gcc/trunk/libgfortran/intrinsics/date_and_time.c:172

-Wimplicit-fallthrough Instances: 
  gengtype-lex.c:380

-Wlto-type-mismatch Instances: 
  /src/gcc/trunk/gcc/ada/fe.h:112
  /src/gcc/trunk/gcc/ada/fe.h:113
  /src/gcc/trunk/gcc/ada/fe.h:135
  /src/gcc/trunk/gcc/ada/fe.h:149
  /src/gcc/trunk/gcc/ada/fe.h:271
  /src/gcc/trunk/gcc/ada/fe.h:49
  /src/gcc/trunk/gcc/ada/fe.h:90
  /src/gcc/trunk/gcc/ada/fe.h:91
  /src/gcc/trunk/gcc/ada/fe.h:92
  /src/gcc/trunk/gcc/ada/gnatvsn.adb:57
  /src/gcc/trunk/gcc/ada/init.c:80
  /src/gcc/trunk/gcc/ada/init.c:82
  /src/gcc/trunk/gcc/ada/init.c:83
  /src/gcc/trunk/gcc/ada/init.c:94
  /src/gcc/trunk/gcc/ada/namet.h:122
  /src/gcc/trunk/gcc/ada/namet.h:49
  /src/gcc/trunk/gcc/ada/namet.h:67
  /src/gcc/trunk/gcc/ada/uintp.h:105
  /src/gcc/trunk/gcc/ada/uintp.h:84
  /src/gcc/trunk/gcc/ada/urealp.h:59

-Wmaybe-uninitialized Instances: 
  g-comlin.adb:583
  g-debpoo.adb:1418
  /src/gcc/trunk/gcc/ada/xref_lib.adb:1039
  /src/gcc/trunk/gcc/ada/xref_lib.adb:1143
  /src/gcc/trunk/gcc/ada/xref_lib.adb:770
  /src/gcc/trunk/gcc/ada/xr_tabls.adb:1015
  /src/gcc/trunk/gcc/ada/xr_tabls.adb:1065
  /src/gcc/trunk/gcc/ada/atree.adb:1776
  /src/gcc/trunk/gcc/ada/atree.adb:2448
  /src/gcc/trunk/gcc/ada/checks.adb:7915
  /src/gcc/trunk/gcc/ada/checks.adb:8129
  /src/gcc/trunk/gcc/ada/checks.adb:8287
  /src/gcc/trunk/gcc/ada/contracts.adb:938
  /src/gcc/trunk/gcc/ada/einfo.adb:10997
  /src/gcc/trunk/gcc/ada/elists.adb:261
  /src/gcc/trunk/gcc/ada/exp_attr.adb:1340
  /src/gcc/trunk/gcc/ada/exp_attr.adb:1430
  /src/gcc/trunk/gcc/ada/exp_ch4.adb:4029
  /src/gcc/trunk/gcc/ada/exp_ch7.adb:8332
  /src/gcc/trunk/gcc/ada/exp_ch7.adb:8729
  /src/gcc/trunk/gcc/ada/exp_ch7.adb:8909
  /src/gcc/trunk/gcc/ada/exp_ch9.adb:3292
  /src/gcc/trunk/gcc/ada/exp_ch9.adb:6177
  /src/gcc/trunk/gcc/ada/exp_ch9.adb:9984
  /src/gcc/trunk/gcc/ada/exp_disp.adb:1060
  /src/gcc/trunk/gcc/ada/exp_disp.adb:1561
  /src/gcc/trunk/gcc/ada/exp_disp.adb:1577
  /src/gcc/trunk/gcc/ada/exp_disp.adb:1672
  /src/gcc/trunk/gcc/ada/exp_disp.adb:1687
  /src/gcc/trunk/gcc/ada/exp_disp.adb:5186
  /src/gcc/trunk/gcc/ada/exp_dist.adb:10036
  /src/gcc/trunk/gcc/ada/exp_dist.adb:1533
  /src/gcc/trunk/gcc/ada/exp_dist.adb:1538
  /src/gcc/trunk/gcc/ada/exp_dist.adb:1555
  /src/gcc/trunk/gcc/ada/exp_dist.adb:1571
  /src/gcc/trunk/gcc/ada/exp_dist.adb:1574
  /src/gcc/trunk/gcc/ada/freeze.adb:1287
  /src/gcc/trunk/gcc/ada/inline.adb:3359
  /src/gcc/trunk/gcc/ada/inline.adb:3493
  /src/gcc/trunk/gcc/ada/nlists.adb:303
  /src/gcc/trunk/gcc/ada/par-ch3.adb:3859
  /src/gcc/trunk/gcc/ada/par-ch9.adb:125
  /src/gcc/trunk/gcc/ada/par-ch9.adb:472
  /src/gcc/trunk/gcc/ada/put_spark_xrefs.adb:167
  /src/gcc/trunk/gcc/ada/put_spark_xrefs.adb:174
  /src/gcc/trunk/gcc/ada/sem.adb:766
  /src/gcc/trunk/gcc/ada/sem_aggr.adb:2874
  /src/gcc/trunk/gcc/ada/sem_aggr.adb:4824
  /src/gcc/trunk/gcc/ada/sem_case.adb:488
  /src/gcc/trunk/gcc/ada/sem_ch12.adb:13651
  /src/gcc/trunk/gcc/ada/sem_ch12.adb:4678
  /src/gcc/trunk/gcc/ada/sem_ch12.adb:5692
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:10056
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:13475
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:13490
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:1854
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:6709
  /src/gcc/trunk/gcc/ada/sem_ch13.adb:8820
  /src/gcc/trunk/gcc/ada/sem_ch3.adb:6699
  /src/gcc/trunk/gcc/ada/sem_ch4.adb:1076
  /src/gcc/trunk/gcc/ada/sem_ch4.adb:1637
  /src/gcc/trunk/gcc/ada/sem_ch4.adb:388
  /src/gcc/trunk/gcc/ada/sem_ch4.adb:8998
  /src/gcc/trunk/gcc/ada/sem_ch5.adb:1474
  /src/gcc/trunk/gcc/ada/sem_ch5.adb:2202
  /src/gcc/trunk/gcc/ada/sem_ch6.adb:1147
  /src/gcc/trunk/gcc/ada/sem_ch6.adb:452
  /src/gcc/trunk/gcc/ada/sem_ch9.adb:3559
  /src/gcc/trunk/gcc/ada/sem_ch9.adb:651
  /src/gcc/trunk/gcc/ada/sem_ch9.adb:692
  /src/gcc/trunk/gcc/ada/sem_ch9.adb:800
  /src/gcc/trunk/gcc/ada/sem_ch9.adb:883
  /src/gcc/trunk/gcc/ada/sem_disp.adb:772
  /src/gcc/trunk/gcc/ada/sem_eval.adb:2344
  /src/gcc/trunk/gcc/ada/sem_eval.adb:6712
  /src/gcc/trunk/gcc/ada/sem_intr.adb:170
  /src/gcc/trunk/gcc/ada/sem_prag.adb:10800
  /src/gcc/trunk/gcc/ada/sem_prag.adb:27655
  /src/gcc/trunk/gcc/ada/sem_prag.adb:27965
  /src/gcc/trunk/gcc/ada/sem_prag.adb:5676
  /src/gcc/trunk/gcc/ada/sem_res.adb:1521
  /src/gcc/trunk/gcc/ada/sem_res.adb:4689
  /src/gcc/trunk/gcc/ada/sem_res.adb:9912
  /src/gcc/trunk/gcc/ada/sem_util.adb:15852
  /src/gcc/trunk/gcc/ada/sem_util.adb:15853
  /src/gcc/trunk/gcc/ada/sem_util.adb:2483
  /src/gcc/trunk/gcc/ada/sem_util.adb:2803
  /src/gcc/trunk/gcc/ada/sem_util.adb:9962
  /src/gcc/trunk/gcc/ada/uintp.adb:1653
  /src/gcc/trunk/gcc/tree-ssa-sccvn.c:2442
  /src/gcc/trunk/libsanitizer/asan/asan_interceptors.cc:57
  /src/gcc/trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:2746
  /src/gcc/trunk/libsanitizer/sanitizer_common/sanitizer_posix.cc:213
  /src/gcc/trunk/libsanitizer/tsan/tsan_interceptors.cc:2185
  /src/gcc/trunk/libsanitizer/ubsan/ubsan_handlers_cxx.cc:109
  s-stoele.adb:82
  s-stusta.adb:228

-Wnonnull Instances: 
  adaint.c:2837
  adaint.c:2839
  /src/gcc/trunk/gcc/ada/adaint.c:2837
  /src/gcc/trunk/gcc/ada/adaint.c:2839

-Wsign-compare Instances: 
  gengtype-lex.c:1367

-Wstringop-overflow Instances: 
  /src/gcc/trunk/gcc/dominance.c:154

-Wuninitialized Instances: 
  g-altcon.adb:135
  g-altcon.adb:150
  g-altcon.adb:170
  g-altcon.adb:185
  g-altcon.adb:205
  g-altcon.adb:220
  g-altcon.adb:242
  g-altcon.adb:257
  g-altcon.adb:277
  g-altcon.adb:292
  g-altcon.adb:312
  g-altcon.adb:327
  g-altcon.adb:349
  g-altcon.adb:364
  g-altcon.adb:384
  g-altcon.adb:399
  g-altcon.adb:419
  g-altcon.adb:434
  g-altcon.adb:456
  g-altcon.adb:471
  g-altcon.adb:493
  g-altcon.adb:508

-Wunused-parameter Instances: 
  socket.c:98
  terminals.c:1377
  terminals.c:1543