http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49401
Summary: Warning regression for 'uninitialized' variable on non-existant code path (in mep-pragma.c) Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: build, diagnostic Severity: normal Priority: P3 Component: other AssignedTo: unassig...@gcc.gnu.org ReportedBy: amyl...@gcc.gnu.org Blocks: 44756 Host: x86_64-unknown-linux-gnu Created attachment 24517 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24517 Preprocessed source file GCC 4.7.0 20110613 (experimental) (revision 174993) warns about a construct in mep-pragma.c which was fine with 4.7.0 20110412. An if clause tests if a variable is within a particular range, and then has a switch that initialized another variable for each possible value of the first variable in the tested-for range. GCC 4.7.0 20110613 now says that the second variable might be uninitialized. amylaar@gcc20:~/pr46489/jun13/multi2/mep-elf/gcc$ /home/amylaar/inst/20110412/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1 -fpreprocessed mep-pragma.i -quiet -dumpbase mep-pragma.c -mtune=generic -march=x86-64 -auxbase mep-pragma -g -O2 -Wextra -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -version -fno-common -o mep-pragma.s GNU C (GCC) version 4.7.0 20110412 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.7.0 20110412 (experimental), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU C (GCC) version 4.7.0 20110412 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.7.0 20110412 (experimental), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 41657c4e14ab8d46a76879065321da34 amylaar@gcc20:~/pr46489/jun13/multi2/mep-elf/gcc$ echo $? 0 amylaar@gcc20:~/pr46489/jun13/multi2/mep-elf/gcc$ /home/amylaar/inst/20110613/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1 -fpreprocessed mep-pragma.i -quiet -dumpbase mep-pragma.c -mtune=generic -march=x86-64 -auxbase mep-pragma -g -O2 -Wextra -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -version -fno-common -o mep-pragma.s GNU C (GCC) version 4.7.0 20110613 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.7.0 20110613 (experimental), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU C (GCC) version 4.7.0 20110613 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.7.0 20110613 (experimental), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 843a960cd48831f97b6a22dedb2d6c40 ../../../gcc/gcc/config/mep/mep-pragma.c: In function ‘mep_pragma_coprocessor’: ../../../gcc/gcc/config/mep/mep-pragma.c:298:54: error: ‘rclass’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ../../../gcc/gcc/config/mep/mep-pragma.c:271:18: note: ‘rclass’ was declared here cc1: all warnings being treated as errors