From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15146 invoked by alias); 3 Jun 2014 16:01:06 -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 15061 invoked by uid 89); 3 Jun 2014 16:01:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 03 Jun 2014 16:01:01 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 93C60AB0C; Tue, 3 Jun 2014 16:00:58 +0000 (UTC) Date: Tue, 03 Jun 2014 16:01:00 -0000 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH, PR 61340] Add default label to two switches on enum ipa_ref_use Message-ID: <20140603160056.GC18456@virgil.suse> Mail-Followup-To: GCC Patches , Jan Hubicka MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00249.txt.bz2 Hi, in PR 61340 it has been reported that clang warns about unhandeld enum values in a switch (gcc does not, I guess I'll open a new PR for that). Fixed thusly by adding a default label with a gcc_unreachable() in both. The potentially unhandled enum value in both cases is IPA_REF_ALIAS which we cannot encounter because 1) in ipa-pure-const.c we are not processing aliases and 2) in ipa-reference.c we analyze references of a function to a variable and that cannot be an alias. OK for trunk? Thanks, Martin 2014-06-03 Martin Jambor PR ipa/61340 * ipa-pure-const.c (propagate_pure_const): Add unreachable default handler for switch on an ipa_ref_use enum. * ipa-reference.c (analyze_function): Likewise. diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 0ebfe5d..b9a3d3e 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1286,6 +1286,8 @@ propagate_pure_const (void) break; case IPA_REF_ADDR: break; + default: + gcc_unreachable (); } better_state (&ref_state, &ref_looping, w_l->state_previously_known, diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index ebff60c..bc58cfa 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -483,6 +483,8 @@ analyze_function (struct cgraph_node *fn) break; case IPA_REF_ADDR: break; + default: + gcc_unreachable (); } }