Message ID | 20240401133146.713531-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=hmNZ8ZlJ; 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=UEBymGgt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4V7X4X2pdkz1yYH for <incoming@patchwork.ozlabs.org>; Tue, 2 Apr 2024 00:32:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE42C3858404 for <incoming@patchwork.ozlabs.org>; Mon, 1 Apr 2024 13:32:24 +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 A43733858D20; Mon, 1 Apr 2024 13:31:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A43733858D20 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 A43733858D20 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=1711978317; cv=pass; b=rnBO+fXRCdJav2AUu1eZY8PDG6Kk0LdzVB0Nk0rcIc1ZQc5iSkHtJBV9tcdyiJWSjrl0/DruMbhXCFSshOFBAj3cnnfJD4XBlHazItYqgGFQZC5LMDJ5mlABSA6aGedGQBKwAgmg5+CrfwU0HxPn2RhNng57RcFS0Tb87G6rO04= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711978317; c=relaxed/simple; bh=VUPCfVJ+9p+lndGhybMqnGp97RfbXkcS5ugD81B+DYo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=g7a1mK3nvpqYaPocJLAeu+IndmebxB5HeEXmbKO8IAW9iEYj4/ZIOgJqwi7Ez2rKPCf/aSkVID5mxGaSxbBMMcgJ6GYMySjLqGos07uK9YbpoZbwx5V6tozcNlgOQsK96A9/IHZEUyyspBvh/j0VDAizMB1OO7Gzr1JcUtA0+m4= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4318j6rd025520; Mon, 1 Apr 2024 13:31:54 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=iYTtex4wG8ofqFsLgpbvhtT3RYDXSpfi1ZX7G2zcp4o=; b=hmNZ8ZlJahzQt7v93/fiy/Gc9bt8klXdTeLzy7txJoDtcMfzmEr+UvtnFQS9g9RpENte RCEw5douPS8A7gq4p6MreA2XbE1fgE3izNlje+r3IXww79ZhBlD9LM6w4W5HXfngkxKZ 9ajmtedOh0X56NnBTwS+zTq6aQKFUW7Xsmjp0CXCXcOYQZ7ZeE3WhT/sMwXovM7ETLz7 j3pEkEvkGMgAtN1KgEo/bYmAQH3cOsOzG1WulQm39VTPuJVUsEJwijQ7Hpwawvm13C1s TKACbVgACUyfGNJpAgI0tox1GgbDlXcFnEVbwrJ+lTd/ycM3MNlugxU8ARU4m8ZLq/5m 0g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x6ambab6h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:31:54 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 431C0acD011637; Mon, 1 Apr 2024 13:31:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x696bvhfb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:31:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i0B+K77fFtgHCAoQ/m+yT6f0nCQ9oNCg+WyXS8WC5IqzP6sCbKWxcdJ/lzTamOphBVXF90+9jjDejFmwlKVf0CHrGNR3v8nKay97C9yXVs38idgia6NKijE9QFRLBamTNfuNgrWS/1IS00d85b0V5ubDe4VZr8QB39yGGWWFFQT2VW9ClOiDfMbag0Yp75v0HrLc7Kuu3u6xHCNLNYW2T4cPmH/b3IbLWb8hc7Bq80apjYp6JM4N0YCWlOYuR/K+VT4JeOQAongBpcqslvbSChYKB1wCmI/GElVMUjvKMe9M5cKxlv0dBAYnHq2PpYMMOYbEqd3z7b8fqicaKPLFoQ== 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=iYTtex4wG8ofqFsLgpbvhtT3RYDXSpfi1ZX7G2zcp4o=; b=AvtqzyyvaC+bljYTpnpKWk6dQXPOTaPR+SWLw3HPHWdl16uO99P6tX0TOKKEAQ0GjkopXmy665A2mpMrTwquBWOsP/5TQcjHsV2BuoyJpCHIZQbiQZkmF33+ichJ4yAoRQtHTyPTvCoecoIefC0JREs/7rVgyTfJdgtb53tl611VPz4DW3FQhlI785hYy3l8ClDQ5BBkoxUarFOArujJdasyK/8+/PXgu7PD7pMwrYP/BscRUrSqo0BFSfAaLEJAe6RLIKhzwuONpOxZZ3D7pIGQsiMyM8SC2veY4GnNA/RlqENG1q196rsdJgKTxYirfKOvZLM6+ycwp10QwEQpgw== 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=iYTtex4wG8ofqFsLgpbvhtT3RYDXSpfi1ZX7G2zcp4o=; b=UEBymGgt4+IRTxhyxMaS9VjoFtnY8aBVUcTft1r32Vw8yqyxTOqRXGIQ3JHmcFzxOJaUxxTWyl3oFQGMudRgxkwTrPU7Iy1v12xgINz2YBecg9m7xevk9vl+ddroWuAAKUfG2ze3fT2p/ojaLj/qOjkgpSUlu0+aIblVWvNNpAE= Received: from CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) by BLAPR10MB5124.namprd10.prod.outlook.com (2603:10b6:208:325::7) 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:31:49 +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:31:49 +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][GCC13] Fix SSA corruption due to widening_mul opt on conflict across an abnormal edge [PR111407] Date: Mon, 1 Apr 2024 13:31:46 +0000 Message-Id: <20240401133146.713531-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0234.namprd03.prod.outlook.com (2603:10b6:a03:39f::29) To CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB6538:EE_|BLAPR10MB5124:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ySjo9/mqeCGalf/N0+qM1xUxrs6/DquDqBsY8r8yRcjMZ/0EXiYMfrWCzssWjPwE4LyWmc1hyv0GEEsM8GgAEai/QgQP1xmyohBxYKJjkzmBiKllb6xwLKIjze3NzzbE9a4JzYKgsNrS06awpNZWDs+VOv827zT5ufzpH5/xbC3KV9jlDdydKg/kV5UiUiKYR1D8Gw1O7P2NEPSXZ/zaTiNnSNHvmbp0KDxlCVf5xZFmv6G59G+08xfmkKwyqHY2yjKlu4Xm3hztg3prUnMTJKMEEFP/bQkx+YFC8np0LG+ZZ/wWRhXfomDHo8XmOOKrfn9HKOhk+wPDEcjN6NqQdkXH+JrI3R0mWrdTOcCgonqE6yNG4U5ROPbpo/pdLrFsgLJiiuTXXs9tPSbg8CkYBMLVHFDOvQJpiOpqfxF4CQ/tOkjutGc6Falur+nN8J+5reu+95GTwETd6GesUaTJlEgvcOeqeRz0zsGG1CYyQoI2Yy3rjSWMBzT6BWRqBaXW1ZIsAk/H3+tZQSMZUq0aIjAhizU7mGzoyYAd45+CVWzkd77jJ1SsPs22/9/joCERGWbiBl2/NEwd0hB4wy3AQfwQgZK6p1cXXa3QCWiM5lE= 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)(1800799015)(376005)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SR8qEdPIXSyT6nD6yG43ELljNHokihRH0o/8NVzKPFy7yLYOhKkoKJIjHVv9flxjaFihxX61QSG3HxzIBvTABu06/AcRYAH3mmIK4WtrA0DT0S5FQrGwggY3c9V9tA+bOXVdl1U2W3b824auRhEpxLnLFy7bTe3mpAIRF/jqGqcUDjH04UlE4G+w0IFIcArDf1Mm46hLN5EnXQunxjMO89rGWvCOqDxAptmn019rVSYt+HJF+29qpZvich6bV/S1Vxh7bboDEH03IkXeqFgt8eyKLPnsGX8iPueXmtEPqDhrgTpZKuVpmtVo6XNuyliyW6JqJsV3ueAHCHWmd7neg7b0mVSQ2Xz+ROIBz7VRGvw4nMZVB4P1jIoSQW8RdJsmaGrY3pzb+Nn9gc0aRAREUQ9hxsEah+BSvodhXQevyDOYPO94BSX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fVmyWkGj4bsiAcHoJnhWwhPngDcFb46xkCtTf32+81jA1Wq5z8H/aVst8hh5YD34oHuOAoB3ZRusW1hefCOikE X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: MZ+zD6jeHglmMWiSFUjcGA2z9pYjtMspaPiLeLSXdPOte3f34WLvgZstbs3QoO0YKoL19Tuharlq7fFsNi0W6QtiUfVAkQ0HFBGMmNdI0G4jld1PvsGMbpC0AkSQgC+f8KTqDx4/VQs7OGQRh7+1UDt+6+iJl/e5lHpbX3fvF01F/UG1Rikgee1LPsNi9xkASdmaAl8/qb/1XpKAx/E+kw5v9wJxBqPjQR7v0rer+TJOrPJD/e/peFx2nh6nw79XFBmZM1ho/9MqvFvjg7Vi/pRzW4PjiP689m114DLcSIKxSViqKXX4topbzqqMwUy75uB8E67QL9b8c6MkrWsE/u8IQ1OTJ80x0SKbk0ils/Zzri9bzNm31OlbsK5rmTzmYlwNJSR1SMSMoqP3tB/doGxCTH4x25Ma36v9pdqtrKiL2bKmS5XkHe/rrNtxI/VUILOhsudtzkhTCPMuzpVHDLq5eojzLNoF9VkFbPSLMYeQfu6oSIr7xXwoEA0CCnOEQyiSn5NspzVFoWHf0rghTqsXHMTy8nW6OK1yZEYJcIOMxkLIAqdQP5cLdPSouBKvRajUKdnB5tGLTNqXlfZlLxgR6A2yB2yj4c7RxqSdpJY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4b325c0-9f83-46c0-5458-08dc525015b2 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:31:49.6348 (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: sEjHUzmhApwMToDQnURgwtIE6eesSnKhUl20JnDeGNLj6PsYBpy0KpHnopL6NOFMCuedEcEwigBEEwp6zXb7RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5124 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 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=949 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2404010096 X-Proofpoint-ORIG-GUID: 1ZCPI6VsQhUBzjKoZz9ezRjDvuTCH9tf X-Proofpoint-GUID: 1ZCPI6VsQhUBzjKoZz9ezRjDvuTCH9tf 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,GCC13] 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 15eed3e960c4..ff949e4fec9c 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -2754,6 +2754,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)