From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2098 invoked by alias); 28 Jan 2014 16:11:44 -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 2082 invoked by uid 89); 28 Jan 2014 16:11:43 -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 16:11:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W8BGB-0005a6-HU from Thomas_Schwinge@mentor.com ; Tue, 28 Jan 2014 08:11:35 -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 08:11:35 -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 16:11:33 +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> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Tue, 28 Jan 2014 16:11:00 -0000 Message-ID: <8738k83x3n.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-01/txt/msg01793.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1821 Hi! On Tue, 28 Jan 2014 06:52:30 -0800, Ian Lance Taylor wrot= e: > 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_unreachable > > 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.? > > --- libiberty/cp-demangle.c > > +++ libiberty/cp-demangle.c > > @@ -5824,6 +5824,8 @@ d_demangle_callback (const char *mangled, int opt= ions, > > NULL); > > d_advance (&di, strlen (d_str (&di))); > > break; > > + default: > > + __builtin_unreachable (); >=20 > You can't call __builtin_unreachable in this code, because libiberty > in stage 1 will be compiled by the host compiler and > __builtin_unreachable is specific to GCC. Right, thanks for catching that. > This patch is OK if you call abort instead of __builtin_unreachable. As soon as I'm clear that this is not in fact a GCC bug, I'll commit the following. already is being included. Source code comment snatched from regex.c. Avoid "'dc' may be uninitialized" warning. libiberty/ * cp-demangle.c (d_demangle_callback): Put an abort call in place, to help the compiler. --- libiberty/cp-demangle.c +++ libiberty/cp-demangle.c @@ -5824,6 +5824,8 @@ d_demangle_callback (const char *mangled, int options, NULL); d_advance (&di, strlen (d_str (&di))); break; + default: + abort (); /* We have listed all the cases. */ } =20 /* If DMGL_PARAMS is set, then if we didn't consume the entire Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 489 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iQEcBAEBAgAGBQJS59asAAoJEK3/DN1sMFFtdDUIAKKLDHBYtrNykviEE5Rx3LoG UFITXF1gfnrPRO1ns0NRsQavISYxP4TZbAW1c5C+mXcJ53KKCMR3P0LYg6qJn7D3 XCwcdMfIi4kpQmxzgf5g7SxMJdrWux9bdlunlNGlBC87Csd54T7GnkpfrWzPCz5D hlIyeSDhEZljpjUBiowxBoCP38Erg2riFHogtXfI4EiUaM/vRfIYmpStHSSGxEUj jZEaUu3nlY2LUpmvDSoEuzQgyX67WwCBG6tnAVtUzK79w9+HCmOhSCRX31A1a5/3 W2znJsNurYsYeIN8JCGBT/tFyzaiMZqB7O7fVSLoZhuasF1hUbXzpZ1UZrTQYmE= =qp1k -----END PGP SIGNATURE----- --=-=-=--