From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98168 invoked by alias); 23 May 2017 17:47:05 -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 98158 invoked by uid 89); 23 May 2017 17:47:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=unwanted, H*Ad:U*bergner 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; Tue, 23 May 2017 17:47:03 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4NHd0ds117089 for ; Tue, 23 May 2017 13:47:04 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ama0t4mkf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 May 2017 13:47:04 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 May 2017 13:47:02 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 May 2017 13:47:00 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4NHl0St43253804; Tue, 23 May 2017 17:47:00 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68CE0FA067; Tue, 23 May 2017 13:44:37 -0400 (EDT) Received: from otta.rchland.ibm.com (unknown [9.10.86.31]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 2F705FA0B5; Tue, 23 May 2017 13:44:37 -0400 (EDT) To: GCC Patches Cc: Richard Biener , Markus Trippelsdorf , Bill Schmidt From: Peter Bergner Subject: [PATCH] Fix PR middle-end/80823, ICE: verify_flow_info failed Date: Tue, 23 May 2017 17:53:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17052317-0048-0000-0000-0000018C5A16 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007106; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00864576; UDB=6.00429207; IPR=6.00644356; BA=6.00005369; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015554; XFM=3.00000015; UTC=2017-05-23 17:47:02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052317-0049-0000-0000-0000413CFE43 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-23_06:,, 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-1705230089 X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01792.txt.bz2 The fix for PR80775 included a thinko bug that caused us to skip some case label statements. This leads to problems for test cases where we have multiple case labels that point to the same unreachable block, but are not mergeable since they don't have consecutive case values. This leads to a problem, because we remove the unreachable block when handling this first case label, but then we have a dangling reference to that block with the skipped case label. The fix is to remove the unwanted increment, so that we handle the next case label and end up removing it too. This passed bootstrap and regtesting on powerpc64le-linux with no regressions. Is this ok for trunk? Peter gcc/ PR middle-end/80823 * tree-cfg.c (group_case_labels_stmt): Delete increment of "i"; gcc/testsuite/ PR middle-end/80823 * gcc.dg/pr80823.c: New test. Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c (revision 248375) +++ gcc/tree-cfg.c (working copy) @@ -1726,7 +1726,6 @@ group_case_labels_stmt (gswitch *stmt) remove_edge_and_dominated_blocks (base_edge); gimple_switch_set_label (stmt, base_index, NULL_TREE); new_size--; - i++; } } Index: gcc/testsuite/gcc.dg/pr80823.c =================================================================== --- gcc/testsuite/gcc.dg/pr80823.c (nonexistent) +++ gcc/testsuite/gcc.dg/pr80823.c (working copy) @@ -0,0 +1,23 @@ +/* PR middle-end/80823 ICE: verify_flow_info failed */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +int a, c; +int b[1]; +static inline int +fn1() { + switch (a) + case 0: + case 2: + return 1; + return 0; +} +void fn2() { + int i; + for (;; ++i) { + c = b[i]; + int d = !fn1(); + if (d) + __asm__(""); + } +}