Message ID | 20240401133302.713970-1-qing.zhao@oracle.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2023-11-20 header.b=c3giZ1c4; dkim=pass (1024-bit key; unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=HF4H3aeW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V7X603ZjKz1yYH for <incoming@patchwork.ozlabs.org>; Tue, 2 Apr 2024 00:33:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6C7B3858C56 for <incoming@patchwork.ozlabs.org>; Mon, 1 Apr 2024 13:33:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 5F47E3858404; Mon, 1 Apr 2024 13:33:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F47E3858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5F47E3858404 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711978393; cv=pass; b=NttFdASTJtAOfLrDHr4DpoIkMGZ6LOvcTr35eKMTk8P2kiM+IQ7cwo+fL3b2S16AFCwUZ7nOw4A2XaSYR0m7OuO9h7EXH7Vozy+0ENxmWacDgaHRb+SEqXstIl75IoPt8UnUd2rv3E5VRBpWimWeWAXe47zw2xWa6jKW7Z6EOZg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711978393; c=relaxed/simple; bh=xc+jEAhPFWWdgoMu56lm3qfANIWfT64HdRrV23kxxSo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=xUnFmYfbXzv1Ebd0K/9oKtB2K6tQQmSHwDShgWPfwTk6tYVMHAgu6k8HqAfeq0Z3n+hCFTJftcraZTQ8rPwDix+tkXUSttRD0cMDTCmJzrKEv800gkoOJFQ12izNkOpFZCISzf6AEQwV30c8p118jy/hFPvKX43+9/ritqQn0zg= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4318iraA018580; Mon, 1 Apr 2024 13:33:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=i5ehIG6Sgwo7t9arIvy+1ryQgXWp6P8x03awZzDglSI=; b=c3giZ1c4kErGDj02X+ev6sweStzUAwEHu3DxWB5Dlx+NSO/bWezIuZlUOeEsNqcH4AZX LgyTs13s6pRjNbUfZ1EvvhU78KuB8yG57u1zZh8M2y+8eGe5l7hQ/hhReB+Zb6uxIuQT SEl+PQmbQR/cZ99Ck3I++wynaGwSW1eUVqqErfaKFAIqYof+m1B8JAFZH/0Pu/UBULMX wkwIsoK3NMMtJbsbJZ7n3DBZzrbkSojSpNmUL5wuCVMXmXOkDhLd6VLOD2iD1ZtbaGjN 7/11xf+BEJ1mpW/bIdrYKRBtvpWYavTCqTbiGqRzMdTL2GuNhDvYrlRMjiCYYk1hyTef /Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x6b9vab4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:33:10 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 431BfHiT021557; Mon, 1 Apr 2024 13:33:08 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x6965m2jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:33:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QHDNjzdT+PSS6ah3O7jYTbmp1EjfRBHneZFPnYsj/GwXQeI4GgPDqmNZV24Y5yNrZKZClT/FBgKPYMpbKzSnTriLaFWurfbUIb1ZN8Fn4PsX8/6sfp3FwzSKFMXkWhyk+xzcfMisSM5XY5uCcT0ANz9q74HrGPJ9xikI7uime1GVAn876lohU+m90Hsc4ytVqI6gKLt4c12z+XI5f1JhQ90NtjSDCImMtj2ObN92X0nmgYeomP0LOb2z1bbr6yy5lZJsltpkPFAgBslahcedTdq25xrKV016zEHLZUrtlBczzQiT1qTnEQ/ypOXtDCyi7/nj0cpmypI1eFrMEWupbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i5ehIG6Sgwo7t9arIvy+1ryQgXWp6P8x03awZzDglSI=; b=Qs4rYvNJarWOVMlrqg8Z3cLEmzaIlNIBNlAz02HzhFYprww3JaZmirEUViQXFhMT4zZAWsmg97KLhlmkSkCwhDzeciIeaFYF+tFuQ0Kdq3eOWyOr44Ep7+UbaJhfQw1SbVkqsru+IJ6j3SV5yy2cSBcuF2nF402k6DXbUs/l2Fs9SPVNaf5ahgsb37y2nTe6CFdX77hDSdrS1ojnrkW0bHtWoltWYgExD76twxca8NVc8xtob4NWjHf5YOhN4JUmWJLRa1RDKfizCeiwVpjq/OIHKItVVXa5a26HlREnsOfrL36nDxj97hIhC2Ih0+ShOVKAE5sIrXxcS61R/u+M2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i5ehIG6Sgwo7t9arIvy+1ryQgXWp6P8x03awZzDglSI=; b=HF4H3aeWbBwB/9BxGxQ894p1LSgv51ha/Q9d8sCQV9mGT7RT2lZrluCgWLJZxnfnQdHUr6r3eVBuXYSLDe41/hacgOOQfD8thGTLjY6oyii8RZdgTRBsSusugwCj2OwScsWfn1ApJ3Rh5kRz6LWqIIjoe3vbwLiCV7b7Y76zklk= Received: from CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) by LV8PR10MB7799.namprd10.prod.outlook.com (2603:10b6:408:1ec::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 1 Apr 2024 13:33:06 +0000 Received: from CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::2dae:7852:9563:b4bc]) by CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::2dae:7852:9563:b4bc%6]) with mapi id 15.20.7409.042; Mon, 1 Apr 2024 13:33:06 +0000 From: Qing Zhao <qing.zhao@oracle.com> To: gcc-patches@gcc.gnu.org Cc: pinskia@gcc.gnu.org, Qing Zhao <qing.zhao@oracle.com> Subject: [PATCH][Backport][GCC12] Fix SSA corruption due to widening_mul opt on conflict across an abnormal edge [PR111407] Date: Mon, 1 Apr 2024 13:33:02 +0000 Message-Id: <20240401133302.713970-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0115.namprd05.prod.outlook.com (2603:10b6:a03:334::30) To CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB6538:EE_|LV8PR10MB7799:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x1Gv/l2cOjAPsQlasWvzjYqozXRPs6bdbRUjYdjvdb6jtpknYj3M69I0ZJyCyha+mEcJmECr7yh3J7yQv2IuUpbZCh8HS/dZ2f/o9T5V9bWl7x75lgCMhAlGFGIHZTl2FdyNw79a8XxpSdDLNTykw9acLPtrCGwpDZlPxuPJL8CiMeKgHBrkUtLlZ8FwJM4Vh0W3vLV6NrqMaNZD+My6pkheNWGT6E4zSY7r9f3sQ6JVZY+AqUhXwXfi+g/Hj9B2t6zKsRyc5Q+GUZg1WaW3D2Nx+gvh/M9MaHhWhqsQ3WsogKgtFtz5fH0XM9y655F0ziLo8JTH2NarBqcfLSTIEeo52tqmN2W/irASL3jzpB5bIHsGpx6n2Btf/ZhNab7FXkD8DH4s1HtbsiQrGRGEDqOCzcufWsT7VgcBdWajpmaH9wwWmxMYyAxkzEsJqnmMSOAhQVEIxTzQqiesNqJ0JE/wnu6KN3bDVzXXcqyj40GmT2Aez5OptVZG8GRO2Xbusn8I2DcthMY6KvqwYwSRWQl4ZIsr6KfR368VEz8cSLYCAapG+S2rFTFXgar6LOVKJxw4112CqmEjfqgwwX3rOz3Li4MtH5Vz1KL9k5FsCok= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY8PR10MB6538.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x/QbkYATjNy+bI620NHkqAmm7sj7T1oEIeNzOQc1ihFcwALBj7g2LlXz4Lew/R2+rR+REzROm8y5DeTg7Xh1v5q1FQ3gun1TD2I3w0fDi7VTFf9Lnv4uJ7FkcPr1zH/mFzwHG5fuyZi0F8CtdsDznoVG4p2KaSMJI7khGAp1QrqbpvqTYhA9Q890QgNJNdVYxYx1ojA4nHNFIABaOI5Jqu1HejwmRkO2+GSzfGCb1SS0iqochcvxZNuKrX6v8wkcOxbCFWmyvOe/mseXY2/K2YJBSdFk3KgduF29/D74801qbabqpPPdA8jUuRBx4n3+31S5b0GPK4LXyoxt+Z4sVOTwUGamNgyUZxaU1LMCzATg3R8eURnVS6sg9oWf/k520zy4nSo3ofgW8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8EsKQxs6JkVchoSuRSMOKJdyQE6V+C1QYT6mcbyuEImEwnYTO5204O6Cc5vOZrKNudfDItVT48vxK9oDcaO83twz6v84pB393npxYTE1D5JLL74oXgsS X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: prYVRmPAiTM3WdMV4gFF15U7VmSXOqOJxS2I5uU+NMG44RVmExo/7ZBjd3v56fmPhVsylDYW4elVck+R14FqSdne9Lq4aDGRK7Tzr60F6xeo7JbpvTm1t8+ztiDK7ng+uzwpLph/CzyFmve0iQLTP4Eg9G4d1C8qZiWBQGmbxAAI/Jhp8F/eeD2kdXL2Q5kL+gDipKkQ5dbiZFnA6sO6EYv21F0nioUHhLXlOZjC1b67i9qthjiI7ylGKUJJffezgHQf35cKcw79L0bQHPrG9lJRrzfldCQi53ArGkgmot18uCQKnWeXLZ7KrR2P1KhKCBYAFOgWH3PtC/vunZmzv/SoDbxNx9B0Lrf1csSxIVDVuAJRRvvQE7hG7QdnukNrZOEHaiDQuX5Ds8R5sW8R1yvcWMES/mZyCm6qUeCKrscu+FwziXdoUwagIzB19ibiiqWrSEGD/JU6lHbDrax1yIBRCoN/MahP9DO+VUxXIyff3v+nP2JS5M6fLHZLtgpUSkkYL+vkuKBPxrmda/1TF9pEcST0EvogkQcUETXHhlrd92mBMi5rVCmzy53Qo0rYceTvUyaohW5XK6BlKnw1+Fm7/TUPph4WE99gtFYRX7Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9efa6070-5608-4101-90a7-08dc52504391 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB6538.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 13:33:06.5416 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MTJDUqioDNcAARj7Jy5DbTs+fYYZIiDgDKQMOj8aRGWE7BcjDOSP01dqwoyS5kXo0kKmP/8lnrQyO71E02J5KA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7799 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-01_09,2024-04-01_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxlogscore=949 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2404010096 X-Proofpoint-ORIG-GUID: LEgUrHgHG99hjc3IbfXnY3lbOs1YxueE X-Proofpoint-GUID: LEgUrHgHG99hjc3IbfXnY3lbOs1YxueE X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[Backport,GCC12] Fix SSA corruption due to widening_mul opt on conflict across an abnormal edge [PR111407]
|
expand
|
diff --git a/gcc/testsuite/gcc.dg/pr111407.c b/gcc/testsuite/gcc.dg/pr111407.c new file mode 100644 index 000000000000..a171074753f9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr111407.c @@ -0,0 +1,21 @@ +/* PR tree-optimization/111407*/ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +enum { SEND_TOFILE } __sigsetjmp(); +void fclose(); +void foldergets(); +void sendpart_stats(int *p1, int a1, int b1) { + int *a = p1; + fclose(); + p1 = 0; + long t = b1; + if (__sigsetjmp()) { + { + long t1 = a1; + a1+=1; + fclose(a1*(long)t1); + } + } + if (p1) + fclose(); +} diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index 232e903b0d25..bab0cc5aef4e 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -2681,6 +2681,14 @@ convert_mult_to_widen (gimple *stmt, gimple_stmt_iterator *gsi) if (!is_widening_mult_p (stmt, &type1, &rhs1, &type2, &rhs2)) return false; + /* if any one of rhs1 and rhs2 is subject to abnormal coalescing, + avoid the tranform. */ + if ((TREE_CODE (rhs1) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs1)) + || (TREE_CODE (rhs2) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs2))) + return false; + to_mode = SCALAR_INT_TYPE_MODE (type); from_mode = SCALAR_INT_TYPE_MODE (type1); if (to_mode == from_mode)