Message ID | 20240401133409.714301-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=daC6UyO1; 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=UTsYtlHH; 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 4V7X7553ywz1yYH for <incoming@patchwork.ozlabs.org>; Tue, 2 Apr 2024 00:34:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D59503858C36 for <incoming@patchwork.ozlabs.org>; Mon, 1 Apr 2024 13:34:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 62F803858C50; Mon, 1 Apr 2024 13:34:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62F803858C50 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 62F803858C50 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711978458; cv=pass; b=JLB7k7UNjKK+52u0qK6pt0pD05CE9fJPaodaasDiR147qKGiT4fRk0vmy7OF5lTpCiCLqeqQFKnrXaMpeytE+loy7tXvsE030PL2dKB1OJcyltBWVpkEM+sLGXEbXr3ZZTXCfeFdYnwAW04hv6zwvDmx43/X2VayyUVwk+u2Ie8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711978458; c=relaxed/simple; bh=WHKihRPciE4LmlehcdQgc7b3cRRPac8QxbSYlhwdd1c=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=YMSd2EIeRMuMrrm1vIlkbbPPnnEzEfb8y594jFNixjkwmPoM6P2HOYZrGdwGn/JH0l9VNnJXzujvuzKCD0s+JJKdYtEku+V9JtypoZ3nvObMOvBFFwnHfWzzsFXhXAoP/b/q7b+zHdPvNqUrZgYm+U1a5LGqotV70TCraqG17YI= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4318i2vp001180; Mon, 1 Apr 2024 13:34:16 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=OMHVhGZLl3BA6gpdlH0/Y+7pdbTfvInaLHqLndxuTok=; b=daC6UyO15i9Yq66N1KxYOYtaihXNIpLspKXTAYqDrw4KC/y+XN15/SeayLf38z3PbMd4 uPCieHTdd8eCNEWrkoCd1Cq8sKpM5y4rqXLmsK7OEhTmdp/ZicdMYE4ELffRZla/jExW FtJKWGSqZ2h9qPHkXkQhb0EiM8Yx9MkNtzpP+QDv06v75e9poCfidxcg40Qe7lvRHSw7 dL4kW97+9wBf7+SL64YR+flKNK3jgCWb6fJwOT17SxfdedkCNu36EGZ5TY/MRJtaL+sA a1RQ7SIcj5wZvTbyxC/xe3zF+Tr1KENg72pooV7q+bzFJSjk70XkiOTlU2aN/NHM86X7 hg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x69h4jcny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:34:15 +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 431DVkQl011772; Mon, 1 Apr 2024 13:34:15 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x696bvp6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Apr 2024 13:34:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ywr2iOfcMcM+X8KfwNcokreDNPftlEF+cNXUj1yvDVmoenkn3oWU/4/v8XfLZ1avieiZP76JprtyNALkrNC9c/O0gC6G0CZIzxn2IkaB51i9W3531BoL93uL1g3BwqnEOnrtypTrMgH4mUSioXrY42cHfq9IG0c33SzXYt8rKqAS4yjtHRKWMYohrWg6J5RJyq0a7E25mh283SwQ8MfeofjFz1umulL36hEJYheerouLdMkh8T+LyWI8L4rivcJ8sB0wSN0LYAuIqsIWV4hgEI5wUlz2EgrmElWHHr14HjoSiSy72qs8EWuCZWgokU15j5vkkJ0uYNIBEDcLQuuLWQ== 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=OMHVhGZLl3BA6gpdlH0/Y+7pdbTfvInaLHqLndxuTok=; b=BPB1AVazwRp6DzoAok6t6C3w8HXkRQwSvX/rhaFYByPMHafs46CVs6PpeE0jhwgKlLOvkDWBqAimBPnAhuNduqtPqLgy8vAXm6ZGqUyRMr2vJYZ0y5/+hgWC65+uB744IXwFc9zLl3a0ROOFF2MIokVrzyCIiAM+LUmnJlDmKYvY0vG16LfAMiQTpch33Jnw0lJC7B2soBqzUcntJVYw27RIrb1qp+SZSGgm4n5nxS6JMSGkpMjqM3S+QRENYCKNdygHMUP+MIvRIvJPPuPhsNyxWIB4Q6B0ljhxz/iLFmBxRwcspWEX/FInhvlEl3f8XtHYfS9QQrksRcBHTkRSmQ== 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=OMHVhGZLl3BA6gpdlH0/Y+7pdbTfvInaLHqLndxuTok=; b=UTsYtlHHDn9aTmZtzXynLT2YeCnFTgpzOUytaEttjx0PJCAZiWXrVuk0W5MjmxDqAlEYWVFYJtcdupjfloS9i20oDT5moGQ3PKYT8U71Iwv9XbdOVhuRxkA9TxN472fgaK+JJxAkkxnjcPXVJhOVTvRDj/i/o1zqS5X2+vxm4zk= 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:34:13 +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:34:12 +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][GCC11] Fix SSA corruption due to widening_mul opt on conflict across an abnormal edge [PR111407] Date: Mon, 1 Apr 2024 13:34:09 +0000 Message-Id: <20240401133409.714301-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0339.namprd03.prod.outlook.com (2603:10b6:a03:39c::14) 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: sPiOTVtCTcU6/hphKNRSUie06mbLES8opyZMw/KD+ao4sGKos8+33mxEuYi0ObTbnK5E47AoxOm/i58snWOLbiSDE81nreoTfSRUhRUtCFpBc+feLPeZSdFg0L1QMnP6Lf8nt4bFQ9YixTGQijztPuN2hY9BFLQ/qYywNDI1g8pFDxzkOeWwCjJ82vluk9P/C+iMlEm7zpX28mzJFFI5aGTF5ya7eNOfuqRk4WWJhPHrFXYWR72SWkN+nfXYXQbMWZszdbs6LAt7mgrlIh2KKfafEXAA7uebG8ZqSsLMy+KkzPuEOoISz2/YwtmOtGKNaQ+bQGSrYmRI5/yEuTVSVd6/4XolLKzNM5uL7tCR57fT8czhkfhmiZHFUW5UhRkawOX5OcqrJcMkv8ZMaKwO00JnKyuhkEPLSBqpkTtA+62d3jHrUx5UqjqJg6xRhrfX78KcoCdidksD5F2ODB8XG2s18w/oeGlFh9KJbMuNdidgNDt8JMVB3V4OxV6iQObrqL1hCSL1Wh/vEMdN8agHiccvSNDIOm7HwE64nydQIOJP0NBFsY1zfWeY90LwtizrIWJ1eIjOctW+3RVIbJE+XW8QKCWlVspZS2bHDL0Ze0w= 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: eK29KA4QQgDXFMu86RYnHoeVXnhqPW20qrcUcNdCYnujlGIxrNTd9nECBdqx8qzGa9ioSudJg8V81yLg7j0yOkQX8xA/Ap/qcsgUEl2RPKAaOu//Rc6Izgl1+YuA30+xDhMMZekAQCGpgJkygHvfuTXLHhQO/+A3DXlOGNYmioP7kll+vw7CAAXkgoK914O1qPmI3J2Pfi/0iXlfNZDRH5GJSrLsnu1kDutdyVBP9GUXyYFp1ZIa9NlfMuBzF0mGemPTlmm9eKsAHLOyXz0QOazsj69vwr4XEVcZzRipO0zikXQep8zUT4echRU7rZ+9wjA4wR7nWNBh+4gD2+8FxuOKI7nRwnF1Oa6r/NH9JTtCli08Je8ouQczXir6SocIyaPHETybiYbZYqt329/bBTBx7asdKjT4u9XK3W94gh251cqLpf7U4fi1uMMcn4Y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NEN7gCSBmKn0p41yGjkWWV9WmEe5hc1lgjsL3onZgdgbz8X+zLbWNrE X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8UVSbiHA4CYgYh8V8A0p7AbVr5zxdgsKMvYeHkcDJmUPEVCBmMf//SIUr+sE3aEaWkC2kiwLwConJLh4SI35X2GVbKpO0BQ5TblX9vW0etFY0MTWiU+PcLbclVHqmLGLVLdFyD5QiySGowdmL9AjNvY4trKe2yG6c1gKAv28X1UaiooI7QFA8w9UgJV4/QyFhmozKvzR3gkTqoAeUNzId3YG5FjcQ9glqwaqyihkNx5AlwMzP8DuePM9fKq3j+m6tB93oth3sNX/8RsXyLA48sfPJAhVuRXkC2jgw65e4NtPfR+FuukU402bQH+vLUEWrug/MfpZg72ZgoKcyLdTUJFnB/6CqTOeon4/C8Kz88EXkQzTaEjQBpo8VcVQKQWIpca2EOvwo8VwTcBHVkGBr6wvEGJGB2mL8DuEoApHgQhaTOIufFfILA1TmlbMeKWwrvRddqpfv8vhPBNFzn2zgjDKQucFZ2Czh+nc87E9RkqJfHhs67ZE8gcxyCv03PrBRxrxdoWF3bylsDtsmkHawLXxNIBuCfjSOv+h2HBdf3bSOGTSnTIO9hghW+MkPueLumUOgBUSyovrYBgmQiHAqraw9soS5bsID59Prh0XM94= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 297ae6fd-ad59-4e5a-a855-08dc52506b26 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:34:12.9256 (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: 7QNgsLSuh+di9EDzC2InJPA+OPvaonegrT8ruyFHMziWcasb1OUpQwzWCo/8vIlEioWMyp70Eo2CvZ8OWORfMQ== 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 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: _gVzCLlUkoXDBY_SBeoujtGodMzL0GS5 X-Proofpoint-GUID: _gVzCLlUkoXDBY_SBeoujtGodMzL0GS5 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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,GCC11] 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.c b/gcc/tree-ssa-math-opts.c index adeb70fd6354..dcaf272d73f9 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -2678,6 +2678,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)