[{"id":1767161,"web_url":"http://patchwork.ozlabs.org/comment/1767161/","msgid":"<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>","list_archive_url":null,"date":"2017-09-12T15:21:49","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":4400,"url":"http://patchwork.ozlabs.org/api/people/4400/","name":"Jeff Law","email":"law@redhat.com"},"content":"On 09/12/2017 01:43 AM, Martin Liška wrote:\n> Hello.\n> \n> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n> does not have CASE_HIGH.\n> \n> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n> \n> Ready to be installed?\n> Martin\n> \n> gcc/ChangeLog:\n> \n> 2017-09-11  Martin Liska  <mliska@suse.cz>\n> \n> \tPR middle-end/82154\n> \t* stmt.c (struct simple_case_node): Assign low to high when\n> \thigh is equal to null.\n> \n> gcc/testsuite/ChangeLog:\n> \n> 2017-09-11  Martin Liska  <mliska@suse.cz>\n> \n> \tPR middle-end/82154\n> \t* g++.dg/torture/pr82154.C: New test.\nOK.\n\nTHough I have to wonder if we should unify the HIGH handling -- having\ntwo different conventions is bound to be confusing.\n\nIn a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\nrefers to a singleton value that is found in CASE_LOW.\n\nThat means we end up doing stuff like this:\n\n if (CASE_HIGH (elt))\n    maxval = fold_convert (index_type, CASE_HIGH (elt));\n  else\n    maxval = fold_convert (index_type, CASE_LOW (elt));\n\n\n\nYou could legitimately argue for changing how this works for tree nodes\nso that there's always a non-null CASE_HIGH.\n\njeff","headers":{"Return-Path":"<gcc-patches-return-461946-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461946-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"oqBBhDKJ\"; dkim-atps=neutral","sourceware.org; auth=none","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=law@redhat.com"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs7nQ1dsyz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 01:22:01 +1000 (AEST)","(qmail 44226 invoked by alias); 12 Sep 2017 15:21:54 -0000","(qmail 44216 invoked by uid 89); 12 Sep 2017 15:21:53 -0000","from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 12 Sep 2017 15:21:52 +0000","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.13])\t(using TLSv1.2 with cipher AECDH-AES256-SHA\n\t(256/256 bits))\t(No client certificate requested)\tby\n\tmx1.redhat.com (Postfix) with ESMTPS id 86767C0587F8;\n\tTue, 12 Sep 2017 15:21:51 +0000 (UTC)","from localhost.localdomain (ovpn-112-32.rdu2.redhat.com\n\t[10.10.112.32])\tby smtp.corp.redhat.com (Postfix) with ESMTP\n\tid 812F317DF7; Tue, 12 Sep 2017 15:21:50 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=PYE/Qx7nxPv7r+pt3rABznQxiYTmbct2CEXDC3YxEAqFPcZ7e6n59\n\tPch/75uDmZ9MC1RfBQq34BQhN5FIYCtzGPhpfGP/5xzGCotD5ZG6Ld+1ZZXIUUXq\n\tBZhDWOl5vDit096OV1KWaLnYHMXcTpCnet34icYHUXejGzQp8lL7jc=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=Qrc+VcFZXBrUiuvPDfdwxXWE/34=; b=oqBBhDKJajZXBYOK94mVo2Xq08OC\n\tN4kpVfoPQcwbI8vY+nc7UBud0fGyrEjowmgoyRn5gp+1XFEd2JIAehY8XtD9ZYvZ\n\tWcqt8KnV0HZHS0RCp9QKtJWdgzPfPlBn2TZK5omjR0SqFWE4Kdkh/r+E/teDSY8t\n\tMJykDAddpur/3w8=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tRP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HIGH,\n\tH*M:8842","X-HELO":"mx1.redhat.com","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 86767C0587F8","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>","From":"Jeff Law <law@redhat.com>","Message-ID":"<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>","Date":"Tue, 12 Sep 2017 09:21:49 -0600","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1767870,"web_url":"http://patchwork.ozlabs.org/comment/1767870/","msgid":"<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>","list_archive_url":null,"date":"2017-09-13T13:08:46","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/people/62010/","name":"Martin Liška","email":"mliska@suse.cz"},"content":"On 09/12/2017 05:21 PM, Jeff Law wrote:\n> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>> Hello.\n>>\n>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>> does not have CASE_HIGH.\n>>\n>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>\n>> Ready to be installed?\n>> Martin\n>>\n>> gcc/ChangeLog:\n>>\n>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>\n>> \tPR middle-end/82154\n>> \t* stmt.c (struct simple_case_node): Assign low to high when\n>> \thigh is equal to null.\n>>\n>> gcc/testsuite/ChangeLog:\n>>\n>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>\n>> \tPR middle-end/82154\n>> \t* g++.dg/torture/pr82154.C: New test.\n> OK.\n> \n> THough I have to wonder if we should unify the HIGH handling -- having\n> two different conventions is bound to be confusing.\n> \n> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n> refers to a singleton value that is found in CASE_LOW.\n> \n> That means we end up doing stuff like this:\n> \n>  if (CASE_HIGH (elt))\n>     maxval = fold_convert (index_type, CASE_HIGH (elt));\n>   else\n>     maxval = fold_convert (index_type, CASE_LOW (elt));\n> \n> \n> \n> You could legitimately argue for changing how this works for tree nodes\n> so that there's always a non-null CASE_HIGH.\n\nHi.\n\nAgree with you that we have a lot of code that does what you just described.\nI tent to change IL representation, where CASE_HIGH is always non-null.\n\n$ git grep 'CASE_HIGH\\>' | wc -l\n125\n\nWhich is reasonable amount of code that should be changed. I'll prepare patch for that.\n\nMartin\n\n> \n> jeff\n>","headers":{"Return-Path":"<gcc-patches-return-462031-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462031-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"mPf/7Sov\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xshp35jBfz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 23:09:30 +1000 (AEST)","(qmail 115412 invoked by alias); 13 Sep 2017 13:08:51 -0000","(qmail 115281 invoked by uid 89); 13 Sep 2017 13:08:50 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 13:08:49 +0000","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id E4CAFAC6C;\n\tWed, 13 Sep 2017 13:08:46 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=aG+gscdbZ/6Vgs8TYDnYUT7x36PXRKf7B5LwBnr3RsRW01eybz/q5\n\tMjDJ+3U3lWxgcF1IqdogECYQ89E8QuenH1zcz+B4cQ/uTU12BZHw37rthp+5J/jT\n\tlvluylQSdc/9KRWNoDRTrRm8WBQUuB43dRZdVBQ8C+0qLuvRp8w0EY=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=uD1IfOjwRurgIElCJ9+Bv3c0lBM=; b=mPf/7SovJviZrZBdBaB8tiFNA9rJ\n\txMcB6kq75kOJP27wg7Op/EzJ3tTK2QVlm0ri/eK7yQt7/ef2jEF32Z05iLBmpHYX\n\tJuL1FTdf70aCX4EAHtJ4GBXA7NmwzcUMbQi+OLVr4N25vIQNHytamg2tmXhJE2vC\n\tt4oNcEt9jgfKwuk=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tSPF_PASS autolearn=ham version=3.3.2\n\tspammy=Hx-languages-length:1618, tent,\n\tHContent-Transfer-Encoding:8bit","X-HELO":"mx1.suse.de","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","Message-ID":"<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>","Date":"Wed, 13 Sep 2017 15:08:46 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1767899,"web_url":"http://patchwork.ozlabs.org/comment/1767899/","msgid":"<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>","list_archive_url":null,"date":"2017-09-13T13:42:20","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/people/62010/","name":"Martin Liška","email":"mliska@suse.cz"},"content":"On 09/13/2017 03:08 PM, Martin Liška wrote:\n> On 09/12/2017 05:21 PM, Jeff Law wrote:\n>> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>>> Hello.\n>>>\n>>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>>> does not have CASE_HIGH.\n>>>\n>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>>\n>>> Ready to be installed?\n>>> Martin\n>>>\n>>> gcc/ChangeLog:\n>>>\n>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>\n>>> \tPR middle-end/82154\n>>> \t* stmt.c (struct simple_case_node): Assign low to high when\n>>> \thigh is equal to null.\n>>>\n>>> gcc/testsuite/ChangeLog:\n>>>\n>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>\n>>> \tPR middle-end/82154\n>>> \t* g++.dg/torture/pr82154.C: New test.\n>> OK.\n>>\n>> THough I have to wonder if we should unify the HIGH handling -- having\n>> two different conventions is bound to be confusing.\n>>\n>> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n>> refers to a singleton value that is found in CASE_LOW.\n>>\n>> That means we end up doing stuff like this:\n>>\n>>  if (CASE_HIGH (elt))\n>>     maxval = fold_convert (index_type, CASE_HIGH (elt));\n>>   else\n>>     maxval = fold_convert (index_type, CASE_LOW (elt));\n>>\n>>\n>>\n>> You could legitimately argue for changing how this works for tree nodes\n>> so that there's always a non-null CASE_HIGH.\n> \n> Hi.\n> \n> Agree with you that we have a lot of code that does what you just described.\n> I tent to change IL representation, where CASE_HIGH is always non-null.\n> \n> $ git grep 'CASE_HIGH\\>' | wc -l\n> 125\n> \n> Which is reasonable amount of code that should be changed. I'll prepare patch for that.\n\nHm, there's one question that pops up: Should we compare the values via pointer equality,\nor tree_int_cst_eq should be done? The later one can messy the code a bit.\n\nMartin\n\n> \n> Martin\n> \n>>\n>> jeff\n>>\n>","headers":{"Return-Path":"<gcc-patches-return-462035-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462035-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"Ch3ldcKu\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsjXG6G1gz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 23:42:38 +1000 (AEST)","(qmail 113281 invoked by alias); 13 Sep 2017 13:42:26 -0000","(qmail 113188 invoked by uid 89); 13 Sep 2017 13:42:24 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 13:42:23 +0000","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id 8873CABB1;\n\tWed, 13 Sep 2017 13:42:20 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:from:to:references:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=xwyoVOSM7WDjcSE0ll94YT2s6/T7HyYrxP8NvEPc1QN5E1JxtroFs\n\tfae+MV4Lxm4aN55uDGcF+IfeDpgBU/vfRp8x8xzO7KMtpxJOHwbLLV0A44DVsJFL\n\tA3PmItHQPJzmhod4sPGFwe4g4R5vYcFyB2N5EOvpoonMU2ix5riLec=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:from:to:references:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=tt5+NmdqQ1/HHEnkfTZEqRI3zEw=; b=Ch3ldcKuGFa0YDlzJAIvhTFNYw1j\n\teNqu83vqSlw99FNf0rMwjwKjG9t/yYHnm1TU6CqzFGAMNSFDNAgpegCKlHhyn8wF\n\tmFSacalufLOipYY27+0gXyWC+uW428QAxBP/MW9kDVNSFA7At3MW3I7j60Td/gS/\n\te7ejEKoLg6adFFg=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tSPF_PASS autolearn=ham version=3.3.2\n\tspammy=HContent-Transfer-Encoding:8bit","X-HELO":"mx1.suse.de","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","To":"Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>\n\t<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>","Message-ID":"<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>","Date":"Wed, 13 Sep 2017 15:42:20 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1767919,"web_url":"http://patchwork.ozlabs.org/comment/1767919/","msgid":"<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>","list_archive_url":null,"date":"2017-09-13T14:22:58","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":4400,"url":"http://patchwork.ozlabs.org/api/people/4400/","name":"Jeff Law","email":"law@redhat.com"},"content":"On 09/13/2017 07:42 AM, Martin Liška wrote:\n> On 09/13/2017 03:08 PM, Martin Liška wrote:\n>> On 09/12/2017 05:21 PM, Jeff Law wrote:\n>>> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>>>> Hello.\n>>>>\n>>>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>>>> does not have CASE_HIGH.\n>>>>\n>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>>>\n>>>> Ready to be installed?\n>>>> Martin\n>>>>\n>>>> gcc/ChangeLog:\n>>>>\n>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>\n>>>> \tPR middle-end/82154\n>>>> \t* stmt.c (struct simple_case_node): Assign low to high when\n>>>> \thigh is equal to null.\n>>>>\n>>>> gcc/testsuite/ChangeLog:\n>>>>\n>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>\n>>>> \tPR middle-end/82154\n>>>> \t* g++.dg/torture/pr82154.C: New test.\n>>> OK.\n>>>\n>>> THough I have to wonder if we should unify the HIGH handling -- having\n>>> two different conventions is bound to be confusing.\n>>>\n>>> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n>>> refers to a singleton value that is found in CASE_LOW.\n>>>\n>>> That means we end up doing stuff like this:\n>>>\n>>>  if (CASE_HIGH (elt))\n>>>     maxval = fold_convert (index_type, CASE_HIGH (elt));\n>>>   else\n>>>     maxval = fold_convert (index_type, CASE_LOW (elt));\n>>>\n>>>\n>>>\n>>> You could legitimately argue for changing how this works for tree nodes\n>>> so that there's always a non-null CASE_HIGH.\n>>\n>> Hi.\n>>\n>> Agree with you that we have a lot of code that does what you just described.\n>> I tent to change IL representation, where CASE_HIGH is always non-null.\n>>\n>> $ git grep 'CASE_HIGH\\>' | wc -l\n>> 125\n>>\n>> Which is reasonable amount of code that should be changed. I'll prepare patch for that.\n> \n> Hm, there's one question that pops up: Should we compare the values via pointer equality,\n> or tree_int_cst_eq should be done? The later one can messy the code a bit.\nI'd like to say pointer equality, but it's probably safer to use\ntree_int_cst_eq.\n\njeff","headers":{"Return-Path":"<gcc-patches-return-462040-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462040-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"v7xHbpxG\"; dkim-atps=neutral","sourceware.org; auth=none","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=law@redhat.com"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xskR66k6Wz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 00:23:13 +1000 (AEST)","(qmail 103656 invoked by alias); 13 Sep 2017 14:23:06 -0000","(qmail 103642 invoked by uid 89); 13 Sep 2017 14:23:06 -0000","from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 14:23:01 +0000","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.11])\t(using TLSv1.2 with cipher AECDH-AES256-SHA\n\t(256/256 bits))\t(No client certificate requested)\tby\n\tmx1.redhat.com (Postfix) with ESMTPS id 6A7D781DEB;\n\tWed, 13 Sep 2017 14:23:00 +0000 (UTC)","from localhost.localdomain (ovpn-112-53.rdu2.redhat.com\n\t[10.10.112.53])\tby smtp.corp.redhat.com (Postfix) with ESMTP\n\tid 756F369FA2; Wed, 13 Sep 2017 14:22:59 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=Mwe52s99gWofBstDZdz1LCIyk82yrMocR9CK8A6g3+EnSUD57wKrd\n\tuX/mKe0Vzlr1FYjCfkREJSq9k3Ho7Tn8Op0lX/RAXGS+IY2UuRj8sF05TeUlfgNN\n\tTj9b7lFxrWpBYf0ZFDBHQyc/uBLooBsFQ8e7esdCiLGjy1OO7VCrHU=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=XIi+Fg63gHmEqaokb12eOH7glSE=; b=v7xHbpxGmS/ojgP4lHIOKNqx3Wzy\n\tAJS4VbDzoNaaEhJVhuFbrTKRBF6uwRtZXAU+VfzO4c3WGrDMFJAczTK2U3fvMb4E\n\tKr6gmnWPXnUXMQtLjatIdP9YoQ6QWVkAVlc02bdqu1O80jVYWAv9RvGAQnJWrbvZ\n\tyJYM4EdyZBDuc9Q=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tRP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mx1.redhat.com","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6A7D781DEB","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>\n\t<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>\n\t<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>","From":"Jeff Law <law@redhat.com>","Message-ID":"<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>","Date":"Wed, 13 Sep 2017 08:22:58 -0600","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1768074,"web_url":"http://patchwork.ozlabs.org/comment/1768074/","msgid":"<f5e220f2-48a1-5711-9888-8de080831f6d@suse.cz>","list_archive_url":null,"date":"2017-09-13T18:09:08","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/people/62010/","name":"Martin Liška","email":"mliska@suse.cz"},"content":"On 09/13/2017 04:22 PM, Jeff Law wrote:\n> On 09/13/2017 07:42 AM, Martin Liška wrote:\n>> On 09/13/2017 03:08 PM, Martin Liška wrote:\n>>> On 09/12/2017 05:21 PM, Jeff Law wrote:\n>>>> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>>>>> Hello.\n>>>>>\n>>>>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>>>>> does not have CASE_HIGH.\n>>>>>\n>>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>>>>\n>>>>> Ready to be installed?\n>>>>> Martin\n>>>>>\n>>>>> gcc/ChangeLog:\n>>>>>\n>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>\n>>>>> \tPR middle-end/82154\n>>>>> \t* stmt.c (struct simple_case_node): Assign low to high when\n>>>>> \thigh is equal to null.\n>>>>>\n>>>>> gcc/testsuite/ChangeLog:\n>>>>>\n>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>\n>>>>> \tPR middle-end/82154\n>>>>> \t* g++.dg/torture/pr82154.C: New test.\n>>>> OK.\n>>>>\n>>>> THough I have to wonder if we should unify the HIGH handling -- having\n>>>> two different conventions is bound to be confusing.\n>>>>\n>>>> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n>>>> refers to a singleton value that is found in CASE_LOW.\n>>>>\n>>>> That means we end up doing stuff like this:\n>>>>\n>>>>   if (CASE_HIGH (elt))\n>>>>      maxval = fold_convert (index_type, CASE_HIGH (elt));\n>>>>    else\n>>>>      maxval = fold_convert (index_type, CASE_LOW (elt));\n>>>>\n>>>>\n>>>>\n>>>> You could legitimately argue for changing how this works for tree nodes\n>>>> so that there's always a non-null CASE_HIGH.\n>>>\n>>> Hi.\n>>>\n>>> Agree with you that we have a lot of code that does what you just described.\n>>> I tent to change IL representation, where CASE_HIGH is always non-null.\n>>>\n>>> $ git grep 'CASE_HIGH\\>' | wc -l\n>>> 125\n>>>\n>>> Which is reasonable amount of code that should be changed. I'll prepare patch for that.\n>>\n>> Hm, there's one question that pops up: Should we compare the values via pointer equality,\n>> or tree_int_cst_eq should be done? The later one can messy the code a bit.\n> I'd like to say pointer equality, but it's probably safer to use\n> tree_int_cst_eq.\n> \n> jeff\n> \n\nOk, so I'll put it on my TODO list as it will take some time to do the transformation.\n\nIn order to fix the PR, I suggest following patch.\n\nReady for trunk?\nMartin\nFrom 1cd8987ad3de4a7bd3e71014a0df9ccb3be40277 Mon Sep 17 00:00:00 2001\nFrom: marxin <mliska@suse.cz>\nDate: Mon, 11 Sep 2017 13:34:41 +0200\nSubject: [PATCH] Fix emission of exception dispatch (PR middle-end/82154).\n\ngcc/ChangeLog:\n\n2017-09-11  Martin Liska  <mliska@suse.cz>\n\n\tPR middle-end/82154\n\t* stmt.c (expand_sjlj_dispatch_table): Use CASE_LOW when\n\tCASE_HIGH is NULL_TREE.\n\ngcc/testsuite/ChangeLog:\n\n2017-09-11  Martin Liska  <mliska@suse.cz>\n\n\tPR middle-end/82154\n\t* g++.dg/torture/pr82154.C: New test.\n---\n gcc/stmt.c                             |  6 ++--\n gcc/testsuite/g++.dg/torture/pr82154.C | 50 ++++++++++++++++++++++++++++++++++\n 2 files changed, 54 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/torture/pr82154.C\n\ndiff --git a/gcc/stmt.c b/gcc/stmt.c\nindex 39d29ff3da9..92bd209ad64 100644\n--- a/gcc/stmt.c\n+++ b/gcc/stmt.c\n@@ -1063,8 +1063,10 @@ expand_sjlj_dispatch_table (rtx dispatch_index,\n       for (int i = ncases - 1; i >= 0; --i)\n \t{\n \t  tree elt = dispatch_table[i];\n-\t  case_list.safe_push (simple_case_node (CASE_LOW (elt),\n-\t\t\t\t\t\t CASE_HIGH (elt),\n+\t  tree high = CASE_HIGH (elt);\n+\t  if (high == NULL_TREE)\n+\t    high = CASE_LOW (elt);\n+\t  case_list.safe_push (simple_case_node (CASE_LOW (elt), high,\n \t\t\t\t\t\t CASE_LABEL (elt)));\n \t}\n \ndiff --git a/gcc/testsuite/g++.dg/torture/pr82154.C b/gcc/testsuite/g++.dg/torture/pr82154.C\nnew file mode 100644\nindex 00000000000..f4e1c3ea139\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/torture/pr82154.C\n@@ -0,0 +1,50 @@\n+// { dg-do compile }\n+// { dg-additional-options \"-Wno-deprecated\" }\n+\n+namespace a {\n+int b;\n+class c\n+{\n+};\n+}\n+class g\n+{\n+public:\n+  g ();\n+};\n+using a::b;\n+class d\n+{\n+public:\n+  d ();\n+  void e ();\n+};\n+class f\n+{\n+  d\n+  i ()\n+  {\n+    static d j;\n+  }\n+  int *k () throw (a::c);\n+};\n+\n+\n+int *f::k () throw (a::c)\n+{\n+  static g h;\n+  i ();\n+  int l = 2;\n+  while (l)\n+    {\n+      --l;\n+      try\n+\t{\n+\t  operator new (b);\n+\t}\n+      catch (a::c)\n+\t{\n+\t}\n+    }\n+  i ().e ();\n+}","headers":{"Return-Path":"<gcc-patches-return-462065-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462065-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"RDJdJzZL\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsqS50GsYz9s7v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 04:09:23 +1000 (AEST)","(qmail 56792 invoked by alias); 13 Sep 2017 18:09:13 -0000","(qmail 56633 invoked by uid 89); 13 Sep 2017 18:09:12 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 18:09:11 +0000","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id 8B690ADA6;\n\tWed, 13 Sep 2017 18:09:08 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type; q=dns; s=default; b=UP25pZ7J3VXJvRQ5+\n\tKcUh6zKK/6+kes1KVO5F014iODG9wQSEm7BPXzPEiHzoIX+9T/U349bXAo1tFJJ1\n\tD5ZUtH7qHLQQlTZNQ8J7phnAzehujYW70yPpX0WWhpIaWyLCIM+DLgZw2rH2r0NL\n\tSL/yn/hpNEAigxoAaor+5drkmM=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type; s=default; bh=ceAiW50OwbgmP/Cq9eo/TQB\n\tXLUI=; b=RDJdJzZLW4zrCySApjbl6QHjSSzp1q12jNqecRUeElWoR+x8gMqLTQR\n\tcmUTVjW/Gbl0TbZ7Gphy67PY+ETB3x9EX30bVnVfhIYVz66tRQP6rUAeNCbd1WT/\n\tWU8CeH5vmH9T7yquLx9cn9qYNFBgWczD2lKWcvfN8R+daFD6NWwU=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mx1.suse.de","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>\n\t<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>\n\t<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>\n\t<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","Message-ID":"<f5e220f2-48a1-5711-9888-8de080831f6d@suse.cz>","Date":"Wed, 13 Sep 2017 20:09:08 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>","Content-Type":"multipart/mixed;\n\tboundary=\"------------D02C8F83087C7DACCD82C7C6\"","X-IsSubscribed":"yes"}},{"id":1768081,"web_url":"http://patchwork.ozlabs.org/comment/1768081/","msgid":"<698093f0-e15c-83eb-dbcf-b96d3b0b0a6d@redhat.com>","list_archive_url":null,"date":"2017-09-13T18:41:58","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":4400,"url":"http://patchwork.ozlabs.org/api/people/4400/","name":"Jeff Law","email":"law@redhat.com"},"content":"On 09/13/2017 12:09 PM, Martin Liška wrote:\n> On 09/13/2017 04:22 PM, Jeff Law wrote:\n>> On 09/13/2017 07:42 AM, Martin Liška wrote:\n>>> On 09/13/2017 03:08 PM, Martin Liška wrote:\n>>>> On 09/12/2017 05:21 PM, Jeff Law wrote:\n>>>>> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>>>>>> Hello.\n>>>>>>\n>>>>>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>>>>>>\n>>>>>> does not have CASE_HIGH.\n>>>>>>\n>>>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>>>>>\n>>>>>>\n>>>>>> Ready to be installed?\n>>>>>> Martin\n>>>>>>\n>>>>>> gcc/ChangeLog:\n>>>>>>\n>>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>>\n>>>>>>     PR middle-end/82154\n>>>>>>     * stmt.c (struct simple_case_node): Assign low to high when\n>>>>>>     high is equal to null.\n>>>>>>\n>>>>>> gcc/testsuite/ChangeLog:\n>>>>>>\n>>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>>\n>>>>>>     PR middle-end/82154\n>>>>>>     * g++.dg/torture/pr82154.C: New test.\n>>>>> OK.\n>>>>>\n>>>>> THough I have to wonder if we should unify the HIGH handling -- having\n>>>>> two different conventions is bound to be confusing.\n>>>>>\n>>>>> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n>>>>> refers to a singleton value that is found in CASE_LOW.\n>>>>>\n>>>>> That means we end up doing stuff like this:\n>>>>>\n>>>>>   if (CASE_HIGH (elt))\n>>>>>      maxval = fold_convert (index_type, CASE_HIGH (elt));\n>>>>>    else\n>>>>>      maxval = fold_convert (index_type, CASE_LOW (elt));\n>>>>>\n>>>>>\n>>>>>\n>>>>> You could legitimately argue for changing how this works for tree nodes\n>>>>>\n>>>>> so that there's always a non-null CASE_HIGH.\n>>>>\n>>>> Hi.\n>>>>\n>>>> Agree with you that we have a lot of code that does what you just described.\n>>>>\n>>>> I tent to change IL representation, where CASE_HIGH is always non-null.\n>>>>\n>>>> $ git grep 'CASE_HIGH\\>' | wc -l\n>>>> 125\n>>>>\n>>>> Which is reasonable amount of code that should be changed. I'll prepare patch for that.\n>>>>\n>>>\n>>> Hm, there's one question that pops up: Should we compare the values via pointer equality,\n>>>\n>>> or tree_int_cst_eq should be done? The later one can messy the code a bit.\n>>>\n>> I'd like to say pointer equality, but it's probably safer to use\n>> tree_int_cst_eq.\n>>\n>> jeff\n>>\n> \n> Ok, so I'll put it on my TODO list as it will take some time to do the transformation.\nNP.  There's nothing inherently wrong with the code today, it's just a\ncleanup (I hope :-)\n\n> \n> \n> In order to fix the PR, I suggest following patch.\n> \n> Ready for trunk?\n> Martin\n> \n> 0001-Fix-emission-of-exception-dispatch-PR-middle-end-821.patch\n> \n> \n> From 1cd8987ad3de4a7bd3e71014a0df9ccb3be40277 Mon Sep 17 00:00:00 2001\n> From: marxin <mliska@suse.cz>\n> Date: Mon, 11 Sep 2017 13:34:41 +0200\n> Subject: [PATCH] Fix emission of exception dispatch (PR middle-end/82154).\n> \n> gcc/ChangeLog:\n> \n> 2017-09-11  Martin Liska  <mliska@suse.cz>\n> \n> \tPR middle-end/82154\n> \t* stmt.c (expand_sjlj_dispatch_table): Use CASE_LOW when\n> \tCASE_HIGH is NULL_TREE.\n> \n> gcc/testsuite/ChangeLog:\n> \n> 2017-09-11  Martin Liska  <mliska@suse.cz>\n> \n> \tPR middle-end/82154\n> \t* g++.dg/torture/pr82154.C: New test.\nOK.\n\nJeff","headers":{"Return-Path":"<gcc-patches-return-462067-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462067-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"Ti968r5v\"; dkim-atps=neutral","sourceware.org; auth=none","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=law@redhat.com"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsrB12gk7z9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 04:42:17 +1000 (AEST)","(qmail 36375 invoked by alias); 13 Sep 2017 18:42:04 -0000","(qmail 36118 invoked by uid 89); 13 Sep 2017 18:42:03 -0000","from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 18:42:02 +0000","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.11])\t(using TLSv1.2 with cipher AECDH-AES256-SHA\n\t(256/256 bits))\t(No client certificate requested)\tby\n\tmx1.redhat.com (Postfix) with ESMTPS id DD8A4356DB;\n\tWed, 13 Sep 2017 18:42:00 +0000 (UTC)","from localhost.localdomain (ovpn-112-53.rdu2.redhat.com\n\t[10.10.112.53])\tby smtp.corp.redhat.com (Postfix) with ESMTP\n\tid 8479C6017B; Wed, 13 Sep 2017 18:41:59 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=mLmQZ5OmVZGzH+nRJoA0idQkfsPO94UlV+pHAesHt7qO4/w8lZZZT\n\tXEmPBr9Kcx4w55oI9WszxefTYJVTTLfK684GyXGCzmAjSMv/KoO0Q2jsWcYPDN9M\n\tCZMfXZpHtHizGIVZslKvHGC+04/RtqUW2AOHzL5rPq9h1lJmbojmKw=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=s22Izxt1Gk6y3eelKzaANJgBNhY=; b=Ti968r5vIuPEfh3TdKrkVp22ATIY\n\tUacOzFNvFHrSPQCF7moqyAnUtqroVMLbKSNDJC0LFQB69j7rQeBFnyTa7mb9YSsc\n\tlhTQ8X21FwNFMJdqKK9rHC2RNs2QrC0eJNf++fv5Kcnc21ETXhLmeczUrHkUuOZk\n\tA+0bf18x09bq0xw=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tRP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mx1.redhat.com","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DD8A4356DB","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>\n\t<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>\n\t<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>\n\t<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>\n\t<f5e220f2-48a1-5711-9888-8de080831f6d@suse.cz>","From":"Jeff Law <law@redhat.com>","Message-ID":"<698093f0-e15c-83eb-dbcf-b96d3b0b0a6d@redhat.com>","Date":"Wed, 13 Sep 2017 12:41:58 -0600","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<f5e220f2-48a1-5711-9888-8de080831f6d@suse.cz>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}},{"id":1768094,"web_url":"http://patchwork.ozlabs.org/comment/1768094/","msgid":"<38473061-4772-c79f-b1fc-cb088a87f650@suse.cz>","list_archive_url":null,"date":"2017-09-13T19:14:34","subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/people/62010/","name":"Martin Liška","email":"mliska@suse.cz"},"content":"On 09/13/2017 08:41 PM, Jeff Law wrote:\n> On 09/13/2017 12:09 PM, Martin Liška wrote:\n>> On 09/13/2017 04:22 PM, Jeff Law wrote:\n>>> On 09/13/2017 07:42 AM, Martin Liška wrote:\n>>>> On 09/13/2017 03:08 PM, Martin Liška wrote:\n>>>>> On 09/12/2017 05:21 PM, Jeff Law wrote:\n>>>>>> On 09/12/2017 01:43 AM, Martin Liška wrote:\n>>>>>>> Hello.\n>>>>>>>\n>>>>>>> In transition to simple_case_node, I forgot to initialize m_high to m_low if a case\n>>>>>>>\n>>>>>>> does not have CASE_HIGH.\n>>>>>>>\n>>>>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n>>>>>>>\n>>>>>>>\n>>>>>>> Ready to be installed?\n>>>>>>> Martin\n>>>>>>>\n>>>>>>> gcc/ChangeLog:\n>>>>>>>\n>>>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>>>\n>>>>>>>      PR middle-end/82154\n>>>>>>>      * stmt.c (struct simple_case_node): Assign low to high when\n>>>>>>>      high is equal to null.\n>>>>>>>\n>>>>>>> gcc/testsuite/ChangeLog:\n>>>>>>>\n>>>>>>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>>>>>>\n>>>>>>>      PR middle-end/82154\n>>>>>>>      * g++.dg/torture/pr82154.C: New test.\n>>>>>> OK.\n>>>>>>\n>>>>>> THough I have to wonder if we should unify the HIGH handling -- having\n>>>>>> two different conventions is bound to be confusing.\n>>>>>>\n>>>>>> In a CASE_LABEL_EXPR the CASE_HIGH can be NULL, which means the label\n>>>>>> refers to a singleton value that is found in CASE_LOW.\n>>>>>>\n>>>>>> That means we end up doing stuff like this:\n>>>>>>\n>>>>>>    if (CASE_HIGH (elt))\n>>>>>>       maxval = fold_convert (index_type, CASE_HIGH (elt));\n>>>>>>     else\n>>>>>>       maxval = fold_convert (index_type, CASE_LOW (elt));\n>>>>>>\n>>>>>>\n>>>>>>\n>>>>>> You could legitimately argue for changing how this works for tree nodes\n>>>>>>\n>>>>>> so that there's always a non-null CASE_HIGH.\n>>>>>\n>>>>> Hi.\n>>>>>\n>>>>> Agree with you that we have a lot of code that does what you just described.\n>>>>>\n>>>>> I tent to change IL representation, where CASE_HIGH is always non-null.\n>>>>>\n>>>>> $ git grep 'CASE_HIGH\\>' | wc -l\n>>>>> 125\n>>>>>\n>>>>> Which is reasonable amount of code that should be changed. I'll prepare patch for that.\n>>>>>\n>>>>\n>>>> Hm, there's one question that pops up: Should we compare the values via pointer equality,\n>>>>\n>>>> or tree_int_cst_eq should be done? The later one can messy the code a bit.\n>>>>\n>>> I'd like to say pointer equality, but it's probably safer to use\n>>> tree_int_cst_eq.\n>>>\n>>> jeff\n>>>\n>>\n>> Ok, so I'll put it on my TODO list as it will take some time to do the transformation.\n> NP.  There's nothing inherently wrong with the code today, it's just a\n> cleanup (I hope :-)\n\nYes.\n\n> \n>>\n>>\n>> In order to fix the PR, I suggest following patch.\n>>\n>> Ready for trunk?\n>> Martin\n>>\n>> 0001-Fix-emission-of-exception-dispatch-PR-middle-end-821.patch\n>>\n>>\n>>  From 1cd8987ad3de4a7bd3e71014a0df9ccb3be40277 Mon Sep 17 00:00:00 2001\n>> From: marxin <mliska@suse.cz>\n>> Date: Mon, 11 Sep 2017 13:34:41 +0200\n>> Subject: [PATCH] Fix emission of exception dispatch (PR middle-end/82154).\n>>\n>> gcc/ChangeLog:\n>>\n>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>\n>> \tPR middle-end/82154\n>> \t* stmt.c (expand_sjlj_dispatch_table): Use CASE_LOW when\n>> \tCASE_HIGH is NULL_TREE.\n>>\n>> gcc/testsuite/ChangeLog:\n>>\n>> 2017-09-11  Martin Liska  <mliska@suse.cz>\n>>\n>> \tPR middle-end/82154\n>> \t* g++.dg/torture/pr82154.C: New test.\n> OK.\n> \n> Jeff\n> \n\nThanks, I've just installed it.\n\nMartin","headers":{"Return-Path":"<gcc-patches-return-462072-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462072-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"EZjtT0h4\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsrvY5Qgkz9sRm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 05:14:47 +1000 (AEST)","(qmail 102923 invoked by alias); 13 Sep 2017 19:14:38 -0000","(qmail 102910 invoked by uid 89); 13 Sep 2017 19:14:38 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 13 Sep 2017 19:14:37 +0000","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id CB6A4AAB2;\n\tWed, 13 Sep 2017 19:14:34 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; q=dns; s=\n\tdefault; b=OHcB+lyCWQs7guWFX9TUdjX+NaUOhJ7nL4saDYpS7QNRb9ZpJQ84Z\n\tVPEPLfxraKkYZ1A4rU4x8xS20UsKLbKm+cK+1JUyQKiijhw4kjN56TuLMGMN6Srq\n\tYArOoN9TJaMStykhqsanvxt8bZrLXcjY8Loru64VWGRKtEqfvnMhtY=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type:content-transfer-encoding; s=default;\n\tbh=RN3VjVFDzi+LAACRT9jr2KYJttM=; b=EZjtT0h4eQOZmShO39fYae45uJdU\n\t4VG5gM4RqaGspnV5toiRhnNs1RHT4f8y/a7ZgL8lYQzkpV2aIKkYyFoXzkbrScWp\n\tu30UUYA4p98gCVl6bbwsV6C/W6yJrtHFFIKC6OtsIFvNjG3jRmGsVrV/JKmi7dfj\n\tGx0P02fgxjbv14Q=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mx1.suse.de","Subject":"Re: [PATCH] Fix emission of exception dispatch (PR\n\tmiddle-end/82154).","To":"Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org","References":"<87dfa677-e748-ff53-28c8-ef24c9f4f553@suse.cz>\n\t<c56d5575-8842-b3de-9469-71bc57610dcd@redhat.com>\n\t<b0562e28-4b25-b32e-c938-b5df49fc301e@suse.cz>\n\t<cdbcf546-c7af-fe5e-f8b7-1993cdd37df6@suse.cz>\n\t<935f7d6e-8b7e-365e-7950-f67d600be691@redhat.com>\n\t<f5e220f2-48a1-5711-9888-8de080831f6d@suse.cz>\n\t<698093f0-e15c-83eb-dbcf-b96d3b0b0a6d@redhat.com>","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","Message-ID":"<38473061-4772-c79f-b1fc-cb088a87f650@suse.cz>","Date":"Wed, 13 Sep 2017 21:14:34 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<698093f0-e15c-83eb-dbcf-b96d3b0b0a6d@redhat.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","X-IsSubscribed":"yes"}}]