From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121459 invoked by alias); 8 May 2017 20:31:42 -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 121386 invoked by uid 89); 8 May 2017 20:31:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=bonus X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 May 2017 20:31:40 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v48KSnYT051431 for ; Mon, 8 May 2017 16:31:41 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2aaky6jcpe-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 May 2017 16:31:41 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 May 2017 14:31:40 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 May 2017 14:31:37 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v48KVb0510617090; Mon, 8 May 2017 13:31:37 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E22CBE042; Mon, 8 May 2017 14:31:37 -0600 (MDT) Received: from [9.10.86.91] (unknown [9.10.86.91]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS id D3D7EBE039; Mon, 8 May 2017 14:31:36 -0600 (MDT) Subject: Re: [PATCH, v3] Fix PR51513, switch statement with default case containing __builtin_unreachable leads to wild branch To: Richard Biener References: <88b0be58-5879-5570-ee06-38ef72dec707@bergner.org> <1ea1d8b4-31f9-c0a4-1537-8acb8fa5fa99@vnet.ibm.com> <5bccbce6-5eb5-65a4-619f-55a04a286a5a@vnet.ibm.com> <4b4b12ad-3801-fd6d-0750-d975ba620841@vnet.ibm.com> <2B12773A-43AF-4223-A006-04DC46B31070@suse.de> <57f5cf26-28cf-2579-a6df-cab9c02af19b@vnet.ibm.com> Cc: GCC Patches , Bill Schmidt , Jakub Jelinek From: Peter Bergner Date: Mon, 08 May 2017 20:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <57f5cf26-28cf-2579-a6df-cab9c02af19b@vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17050820-0012-0000-0000-00001431B322 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007035; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000209; SDB=6.00857894; UDB=6.00424999; IPR=6.00637328; BA=6.00005333; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015361; XFM=3.00000015; UTC=2017-05-08 20:31:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050820-0013-0000-0000-00004D9134EC Message-Id: <629e950a-c185-7125-742d-a89cedf84013@vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-08_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705080110 X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00589.txt.bz2 On 05/08/2017 01:20 PM, Peter Bergner wrote: > That is what the previous patch did, but as I mention above, > we generate slightly better code for some test cases (other > tests seemed to generate the same code) if we don't attempt > to handle the decision tree case. I'll note that the current > unpatched compiler already knows how to remove unreachable > case statement blocks when we expand to a decision tree. I should be more careful with my description here. The patch does affect both unreachable case statements for both decision trees as well as jump tables, and that leads to improved code for both decision trees as well as jump tables. What I meant to say above, is that the current handling of unreachable default case statements in the unpatched compiler seems to lead to slightly better code for some test cases than attempting to handle default_label == NULL in the decision tree code. It was for that reason, I placed the code in expand_case() only in the jump table path. The fact it made the patch smaller was a bonus, since I didn't need to protect emit_case_nodes() from a NULL default_label. As I said, if you think it will help some test case I haven't tried yet, I can add that support back. Peter