From patchwork Tue Sep 12 07:43:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 812715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-461888-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qG7yT9ku"; dkim-atps=neutral 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 3xrxdy1SsHz9s7B for ; Tue, 12 Sep 2017 17:44:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=vfjjpwfRZVjPlvfVGg13pfUKB+rYbZardC0xJeDCLpRhaoyeAwg8z H/Yfi9xNpvhNONQ+IGFkRrd19hex1v0VM+nERnbs60mNssR+qzFyJN+keD+4DVaS gBxSnNwurlrPCumka/I+h3E/oJ+Vo5Vijkhmuf/i0+M5tBXh0+rH1o= 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 :subject:to:message-id:date:mime-version:content-type; s= default; bh=MQjpH6Zcl0uNj8IlfLBwYceyJoQ=; b=qG7yT9kuGzu1Pwggahfk 7x01S7+7vi0ZQ5ysrww9xz7lo9w8SjJA1tgGGmNjppj6MffxXlKWzfhKzAsXGYTl p0q020EMOJz21AxYn380zJIbxtpo9yasKdBpRNtJ0eHycVR9aySwL4+eHR79FGR1 v28Fc7PqAC5touvN6vjsquI= Received: (qmail 90731 invoked by alias); 12 Sep 2017 07:44:15 -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 77531 invoked by uid 89); 12 Sep 2017 07:43:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1908, Lowest X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Sep 2017 07:43:43 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5021FABB0 for ; Tue, 12 Sep 2017 07:43:41 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Fix emission of exception dispatch (PR middle-end/82154). To: gcc-patches@gcc.gnu.org Message-ID: <87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz> Date: Tue, 12 Sep 2017 09:43:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hello. In transition to simple_case_node, I forgot to initialize m_high to m_low if a case does not have CASE_HIGH. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin gcc/ChangeLog: 2017-09-11 Martin Liska PR middle-end/82154 * stmt.c (struct simple_case_node): Assign low to high when high is equal to null. gcc/testsuite/ChangeLog: 2017-09-11 Martin Liska PR middle-end/82154 * g++.dg/torture/pr82154.C: New test. --- gcc/stmt.c | 3 +- gcc/testsuite/g++.dg/torture/pr82154.C | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr82154.C diff --git a/gcc/stmt.c b/gcc/stmt.c index 39d29ff3da9..9b33657372f 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -71,7 +71,8 @@ along with GCC; see the file COPYING3. If not see struct simple_case_node { simple_case_node (tree low, tree high, tree code_label): - m_low (low), m_high (high), m_code_label (code_label) + m_low (low), m_high (high != NULL_TREE ? high : low), + m_code_label (code_label) {} /* Lowest index value for this label. */ diff --git a/gcc/testsuite/g++.dg/torture/pr82154.C b/gcc/testsuite/g++.dg/torture/pr82154.C new file mode 100644 index 00000000000..f4e1c3ea139 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr82154.C @@ -0,0 +1,50 @@ +// { dg-do compile } +// { dg-additional-options "-Wno-deprecated" } + +namespace a { +int b; +class c +{ +}; +} +class g +{ +public: + g (); +}; +using a::b; +class d +{ +public: + d (); + void e (); +}; +class f +{ + d + i () + { + static d j; + } + int *k () throw (a::c); +}; + + +int *f::k () throw (a::c) +{ + static g h; + i (); + int l = 2; + while (l) + { + --l; + try + { + operator new (b); + } + catch (a::c) + { + } + } + i ().e (); +}