On 9/2/16, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > On Fri, Sep 02, 2016 at 05:08:34PM -0400, Eric Gallager wrote: >> > The only way to know for sure what GCC is warning about is to look at >> > the uninit dump. >> >> How exactly do I generate an uninit dump? I'm not seeing any relevant >> options in the GCC manual... > > -fdump-tree-uninit >
I tried that but it doesn't look like it produced any dumpfiles... although adding -save-temps to the command gave me an extra 'note' that wasn't there before: $ /usr/local/bin/g++ -std=gnu++98 -fno-PIE -c -g -mdynamic-no-pic -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -fdump-tree-uninit -fdump-tree-uninit-details -fdump-tree-uninit-blocks-details -fdump-tree-cddce2 -fdump-tree-cddce2-blocks -dA -dD -dP -freport-bug -fsched-verbose=5 -fchecking=2 -save-temps -Wall -Wextra -Wc++11-compat -Wnarrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wno-implicit-fallthrough -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I/private/var/root/gcc-git/my_oddly_named_builddir/./gmp -I/private/var/root/gcc-git/gmp -I/private/var/root/gcc-git/my_oddly_named_builddir/./mpfr/src -I/private/var/root/gcc-git/mpfr/src -I/private/var/root/gcc-git/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace -I/private/var/root/gcc-git/my_oddly_named_builddir/./isl/include -I/private/var/root/gcc-git/isl/include -o combine.o -MT combine.o -MMD -MP -MF ./.deps/combine.TPo ../../gcc/combine.c../../gcc/combine.c: In function ‘int combine_instructions(rtx_insn*, unsigned int)’: ../../gcc/combine.c:1310:8: warning: ‘prev’ may be used uninitialized in this function [-Wmaybe-uninitialized] if ((next = try_combine (insn, prev, NULL, NULL, ^~ ../../gcc/combine.c:1125:13: note: ‘prev’ was declared here rtx_insn *prev; ^~~~ I tried again without '-save-temps' and confirmed that the extra 'note' disappeared again. >> > Moreover, if the warning is bogus and not a regression, it is very >> > likely that it is reported already here: >> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639 >> > >> > The effort dedicated to report and analyze the report would be better >> > spent fixing any of the issues already known. >> > >> > Nevertheless, assignments within 'if' are one of the things that make >> > reading GCC code harder than it needs to be (and combine.c is scary). >> >> So would a patch to move the assignment out of the 'if' be better then? > > Not really; this idiom is used all over the place in combine (including > a few times with this same variable!) > > It seems to be a regression, anyway? Older versions built fine? > > > Segher > I wasn't really paying as close attention with older versions; I was only looking at the warnings this time to silence the narrowing ones: https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02129.html ...and so I noticed this one and figured I'd try to silence it as well. It still built fine anyways; it was just a warning and not an error after all. (IOW I don't know if this is a regression or not)