From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15530 invoked by alias); 14 Jun 2011 08:59:06 -0000 Received: (qmail 15511 invoked by uid 22791); 14 Jun 2011 08:59:04 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 08:58:50 +0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/49401] New: Warning regression for 'uninitialized' variable on non-existant code path (in mep-pragma.c) X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: build, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: amylaar at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Tue, 14 Jun 2011 08:59:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01163.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49401 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: unassigned@gcc.gnu.org ReportedBy: amylaar@gcc.gnu.org Blocks: 44756 Host: x86_64-unknown-linux-gnu Created attachment 24517 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D24517 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 varia= ble 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=3Dgeneric -march=3Dx86-64 -auxbase mep-pragma -g -O2 -Wextra -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attri= bute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werr= or -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=3D30 --param ggc-min-heapsize=3D4096 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=3D30 --param ggc-min-heapsize=3D4096 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=3Dgeneric -march=3Dx86-64 -auxbase mep-pragma -g -O2 -Wextra -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attri= bute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werr= or -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=3D30 --param ggc-min-heapsize=3D4096 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=3D30 --param ggc-min-heapsize=3D4096 Compiler executable checksum: 843a960cd48831f97b6a22dedb2d6c40 ../../../gcc/gcc/config/mep/mep-pragma.c: In function =E2=80=98mep_pragma_c= oprocessor=E2=80=99: ../../../gcc/gcc/config/mep/mep-pragma.c:298:54: error: =E2=80=98rclass=E2= =80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] ../../../gcc/gcc/config/mep/mep-pragma.c:271:18: note: =E2=80=98rclass=E2= =80=99 was declared here cc1: all warnings being treated as errors