From patchwork Tue Jan 28 16:11:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 314748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B2362C00A1 for ; Wed, 29 Jan 2014 03:11:51 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=Z4svPz5x4YQujeSA Q4ILqAx4gxepvejEz6RuC6cIJNNsx8mEOP534u9IzIwUIci8IqK0plafwHRWN20o Uie0TVeTDoTSc5aja/STBft6QZ7YT6Luro7xV6DlfEVWNADF2DJE30NmsRMV1yRz eUJkotuOip1JEU7jtfFW103IXhs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=exhYTtO0HDz/g4mHQkThOF N0R/Y=; b=DQ1+6ZxV3Uqr99KZwM0EuN6oGkvqymg1zCWQ/5UJjF2+1aA13jWZpp NRZVaxr+P9RVq+5GnxFpQCB/ZdSLaRNRgJJ5LB/I88kv/jLW5Hto16Y2CQo5nVnP QNDRad85YV5i4ZOYt4F7CHFtL7J6d41pMxrnuFvhfLu+m+N+jixUE= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 17:11:24 +0100 Message-ID: <8738k83x3n.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! 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_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 options, > > NULL); > > d_advance (&di, strlen (d_str (&di))); > > break; > > + default: > > + __builtin_unreachable (); > > 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. Grüße, Thomas --- 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. */ } /* If DMGL_PARAMS is set, then if we didn't consume the entire