From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30782 invoked by alias); 28 Jan 2014 21:10:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 30772 invoked by uid 89); 28 Jan 2014 21:10:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Jan 2014 21:10:56 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W8Fvm-0001FA-QL from Thomas_Schwinge@mentor.com ; Tue, 28 Jan 2014 13:10:50 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 28 Jan 2014 13:10:49 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Tue, 28 Jan 2014 21:10:48 +0000 From: Thomas Schwinge To: Ian Lance Taylor CC: gcc-patches , Dmitry Vyukov , Alexey Samsonov , Konstantin Serebryany , Jakub Jelinek Subject: Re: -Og bug? In-Reply-To: References: <20131206075033.GE892@tucnak.redhat.com> <20131206082507.GF892@tucnak.redhat.com> <20131206095337.GH892@tucnak.redhat.com> <20131210113834.GQ892@tucnak.redhat.com> <87bnyw41hf.fsf@kepler.schwinge.homeip.net> <8738k83x3n.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Tue, 28 Jan 2014 21:10:00 -0000 Message-ID: <871tzrq0bw.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-01/txt/msg01814.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1900 Hi! On Tue, 28 Jan 2014 09:12:44 -0800, Ian Lance Taylor wrot= e: > On Tue, Jan 28, 2014 at 8:11 AM, Thomas Schwinge > wrote: > > On Tue, 28 Jan 2014 06:52:30 -0800, Ian Lance Taylor = wrote: > >> On Tue, Jan 28, 2014 at 6:36 AM, Thomas Schwinge > >> wrote: > >> > Avoid "'dc' may be uninitialized" warning. > >> > > >> > libiberty/ > >> > * cp-demangle.c (d_demangle_callback): Put __builtin_unreach= able > >> > in place, to help the compiler. > > > > For my own education: why is this not considered a GCC trunk bug? It is > > xgcc/cc1 which is coming up with this (bogus?) warning, but only for -Og > > and not for -O0, -O1, etc.? >=20 > I don't really have an opinion on whether this is a bug in GCC or > not. Since libiberty is compiled by other compilers, I think your > cp-demangle.c patch is reasonable and appropriate either way. >=20 > In particular, it's not a bug for the compiler to consider the > possibility that type may take on a value not named in the enum. > C/C++ impose no restrictions on values of enum type. It's valid to > write code that stores a value that is not an enum constant into a > variable of enum type, so it's reasonable for the compiler to consider > the possibility, even though we can clearly see that it can not > happen. OK, I agree to all of that, but I'd assume that if the compiler doesn't do such value tracking to see whether all cases have been covered, it also souldn't emit such possibly unitialized warning, to not cause false positive warnings. > I don't know why the compiler reports a different warning for -O1 and > -Og. I encourage you to reduce the code into a standalone test case > and file a bug report. . Will try to continue with that one, but at low priority. Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 489 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJS6BzTAAoJENuKOtuXzphJJOoIAKUyq7qMOIuxa0yNaOLR+rD5 d8nvdBiiYZQcm/tduXRXqH8qZGr9wC8KzspTWrvJWKXUKsRcbO/lfQhIOXmjoXik PTlfi0Z1PtnDPjD4W28tRwBKW2rQdSbcKb9niKLdbManJGcRgOomljqHtftHqCDB ZvDr4yDQpUzd3NLu6fquN8BBTWrSTBbVzamzbWH43QVnbzS6LwoFdQ6yzrhGHTas kHhpv5ural7GE0mkIeKZ4JcGlk3uO4YqbXJlIdxBLhHkLiaep9WYCUKW6ZtFO/hV 4YLDvFovFLAtQHRvrywz77Z6GW0/4U3zyooBBR8ehaNkK1LE1Q1ugQlRWYZO1oU= =VvT9 -----END PGP SIGNATURE----- --=-=-=--