From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D3D5A3858423 for ; Tue, 26 Oct 2021 10:08:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3D5A3858423 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19Q9lxtR027529 for ; Tue, 26 Oct 2021 10:08:15 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bx4msrnwr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Oct 2021 10:08:14 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19Q9sFSk024690 for ; Tue, 26 Oct 2021 10:08:14 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bx4msrnvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Oct 2021 10:08:14 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19QA2wn0014069; Tue, 26 Oct 2021 10:08:12 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3bx4f23w1e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Oct 2021 10:08:12 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19QA8A8r60228038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Oct 2021 10:08:10 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 287224204B; Tue, 26 Oct 2021 10:08:10 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34FA94204F; Tue, 26 Oct 2021 10:08:09 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.200.50.208]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 26 Oct 2021 10:08:08 +0000 (GMT) Subject: Re: [PATCH] forwprop: Remove incorrect assertion [PR102897] To: Richard Biener Cc: GCC Patches References: <96541e9b-46ff-e4a1-e60c-1d035f219560@linux.ibm.com> From: "Kewen.Lin" Message-ID: <79737851-dd1b-8b57-30a7-e883b6205a58@linux.ibm.com> Date: Tue, 26 Oct 2021 18:08:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: xit_3PoeSdcttleJotyDRdczbFY7nB4T X-Proofpoint-GUID: _1h2Fc-TtcNn5TtWwBUQOfNZOvf5h-Gv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-26_02,2021-10-26_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2110260057 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2021 10:08:17 -0000 Hi Richi, on 2021/10/26 下午3:50, Richard Biener wrote: > On Tue, Oct 26, 2021 at 5:40 AM Kewen.Lin wrote: >> >> Hi, >> >> As PR102897 shows, there is one incorrect assertion in function >> simplify_permutation, which is based on the wrong assumption that >> all cases with op2_type == tgt_type are handled previously, the >> proposed fix is to remove this wrong assertion. >> >> Bootstrapped and regtested on x86_64-redhat-linux, >> aarch64-linux-gnu and powerpc64{,le}-linux-gnu. > > I think you need to enable optimization in the new testcase, gcc.dg/ only > runs -O0 by default which wouldn't trigger forwprop? Please verify the > testcase ICEs before the fix. > Thanks for catching! You are right, the optimization option is required, I just verified it and committed with the additional "-O1" as r12-4705. > Otherwise OK. > Thanks! BR, Kewen > Thanks, > Richard, > >> BR, >> Kewen >> ----- >> gcc/ChangeLog: >> >> PR tree-optimization/102897 >> * tree-ssa-forwprop.c (simplify_permutation): Remove a wrong assertion. >> >> gcc/testsuite/ChangeLog: >> >> * gcc.dg/pr102897.c: New test. >> --- >> gcc/testsuite/gcc.dg/pr102897.c | 16 ++++++++++++++++ >> gcc/tree-ssa-forwprop.c | 2 -- >> 2 files changed, 16 insertions(+), 2 deletions(-) >> create mode 100644 gcc/testsuite/gcc.dg/pr102897.c >> >> diff --git a/gcc/testsuite/gcc.dg/pr102897.c b/gcc/testsuite/gcc.dg/pr102897.c >> new file mode 100644 >> index 00000000000..d96b0e48ccc >> --- /dev/null >> +++ b/gcc/testsuite/gcc.dg/pr102897.c >> @@ -0,0 +1,16 @@ >> +/* { dg-do compile } */ >> +/* Specify C99 to avoid the warning/error on compound literals. */ >> +/* { dg-options "-std=c99" } */ >> + >> +/* Verify that there is no ICE. */ >> + >> +typedef __attribute__((vector_size(8))) signed char int8x8_t; >> +typedef __attribute__((vector_size(8))) unsigned char uint8x8_t; >> + >> +int8x8_t fn1 (int8x8_t val20, char tmp) >> +{ >> + uint8x8_t __trans_tmp_3; >> + __trans_tmp_3 = (uint8x8_t){tmp}; >> + int8x8_t __a = (int8x8_t) __trans_tmp_3; >> + return __builtin_shuffle (__a, val20, (uint8x8_t){0}); >> +} >> diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c >> index 5b30d4c1a76..a830bab78ba 100644 >> --- a/gcc/tree-ssa-forwprop.c >> +++ b/gcc/tree-ssa-forwprop.c >> @@ -2267,8 +2267,6 @@ simplify_permutation (gimple_stmt_iterator *gsi) >> if (!VECTOR_TYPE_P (tgt_type)) >> return 0; >> tree op2_type = TREE_TYPE (op2); >> - /* Should have folded this before. */ >> - gcc_assert (op2_type != tgt_type); >> >> /* Figure out the shrunk factor. */ >> poly_uint64 tgt_units = TYPE_VECTOR_SUBPARTS (tgt_type); >> -- >> 2.27.0