| Message ID | 20250912190843.4056865-1-qing.zhao@oracle.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 398583857B90 for <patchwork@sourceware.org>; Fri, 12 Sep 2025 19:09:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 398583857B90 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2025-04-25 header.b=nDaorKEw; 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=jLyzPMWk 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 C25523858D21 for <gcc-patches@gcc.gnu.org>; Fri, 12 Sep 2025 19:08:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C25523858D21 Authentication-Results: sourceware.org; dmarc=pass (p=reject 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 C25523858D21 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=1757704130; cv=pass; b=NoiJKfo9OS+GIgG9/uQBQuiX4AM6ni/UKs5WkQ5TJR5CN397d4EbiWn0qpmoVcFq9fMfzHzY3xdtF7wWIpmyiMo6UebZrbc9oakFnea8umMV+1KXgnbCzxpubfn6nkekpyuR9xwrNj9v1zOUQRXrcyhNDdlM5jjtGuVtlylZFd8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1757704130; c=relaxed/simple; bh=Vr5FDyFj2sOOJjC0CDSwwi0M8Vm52D/Bkh/Or4JQo2k=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=JKfxfgsay6iNQxbpaqZaW+MCFlhCbCGJD1WsVGw2CZUgy+WY0/Urr6PMrWKCLVYBRqN1+2rFM2/4fUb3UYa4rnee4nmU0LbHFlAxR//NNhy6WjHgfb5i7le4RabPm7jWcL4TRhdxy3WWoAro1b+bFAst2SxYGYjbKeQ/MVRyPKM= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C25523858D21 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58CIMvda019294; Fri, 12 Sep 2025 19:08:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2025-04-25; bh=pro1xlsD/cQCqvYS lu0wQlUg+2n16nYuGsjv4yeXAuU=; b=nDaorKEwF73ZJaCYo2VHNhrMfokt+pno YPzrGYgET41XyqNk7w1x9eo9M04FtsNoYgwLE0txZ1JUPyDGORq4GGszXM6gckiM WWByn6g53r3uzmh6zSWHydcwWFd0N4dBXCyg4jsi/3N0FzMUSGaCKGdP0ojrlpBx ajMy08ar5UnAxpN+uNFe5eTaquAp5QNMRNakUkbg/xgttjLslgARWDpwlTO0qG5Q t0zCusxo8M/aI6Q8norvOhiYjmGYlc3oSx1hUgzR67ZjqC+ihf3zrw5YmqRy/UlN 1PNOEtF8Zg7x8XrSwtV7vwvWCyocpI9BpJ+C09xsbuMIv4iw9fFLpA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 49226t0v8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Sep 2025 19:08:50 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 58CHSXox038736; Fri, 12 Sep 2025 19:08:49 GMT Received: from bn8pr05cu002.outbound.protection.outlook.com (mail-eastus2azon11011061.outbound.protection.outlook.com [52.101.57.61]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 490bde9kts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Sep 2025 19:08:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YgkCXqOyd9aMJp7BgW6y5bS/CqOTXqhKw4Kl1nnVbCDSvT2hlLnjeSuq1A1xtCPAD+ty/CSvb1AOWD7kzgdrbJwQPFp9f8skV93MAquDK6txkWJBUt0NDGcrJ1mcKYYNt+z5aQMWxA/SedL2gCpQtAFmJEBoZ2UAZkkcYvBO2QL1ZHTf/y03rdNHL8+BR2oAGvkucG5m9Hc99OSVP0wqAlOdNyhSahkgBnlgtOikgdBu7K5bcGVdIp9JEm2kn7u88r4iJBDps1oeu62+dFOWX7ff9lP7zz6mFpdFAXjzwcQS6Smh1Fm3P1deeWPerXygKq6fx5Sg8FqGCI3Q3SqZIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=pro1xlsD/cQCqvYSlu0wQlUg+2n16nYuGsjv4yeXAuU=; b=ZakKI2kjCc6nH96oXr7tkJb90ChHPRQO2/gVaXWig9o5gKKwpH0UKh9yz+nfCNxYgRhBR7TN3S/VUL9Xe9smvMLNLvMoPjJH9pNXyY3kW3z7S5KX6v78biJTbIMRKEl6CcS41UDwDywivVJVxV2XR18Tx5fP4BQM29vQ3fgtrmudd2CeNpkobkDI7FOF7f8Wx4V5Lwn9vb5u7HqgCmvKigCzASPB7oLVAUDbsTgecKK9OJ7c5xhgFIdIApqvhVHT2sD4Oyp/K9ScknijA6EBholmElkFfPAppbJ96dZIEcU8fWthT70RRa/6n51xd2EmKJgr7XN8HGdPp/blcJG5cA== 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=pro1xlsD/cQCqvYSlu0wQlUg+2n16nYuGsjv4yeXAuU=; b=jLyzPMWk89Q514TZKZf1iJWw9iXYcKeQ9xhmT9GEKzKj7sew8zzgkhoPC3RentzRtTkgD+EJRSVkOCPRiplS5aqjiC5uLmbFOLdwJyJI6liGVj6DkPrWTYnPiq26v1orhyAEDPqKMTpcR0F0ouejMVBR3V5QMNNvO9SyE9Y/Rqo= Received: from CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) by CH3PR10MB6764.namprd10.prod.outlook.com (2603:10b6:610:144::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.18; Fri, 12 Sep 2025 19:08:47 +0000 Received: from CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::83c0:6ad9:b202:784e]) by CY8PR10MB6538.namprd10.prod.outlook.com ([fe80::83c0:6ad9:b202:784e%3]) with mapi id 15.20.9094.021; Fri, 12 Sep 2025 19:08:47 +0000 From: Qing Zhao <qing.zhao@oracle.com> To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com, rguenther@suse.de, mjambor@suse.cz, Qing Zhao <qing.zhao@oracle.com> Subject: [PATCH] Fix SRA issue with -ftrivial-auto-var-init= [PR121894] Date: Fri, 12 Sep 2025 19:08:43 +0000 Message-Id: <20250912190843.4056865-1-qing.zhao@oracle.com> X-Mailer: git-send-email 2.31.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR10CA0002.namprd10.prod.outlook.com (2603:10b6:510:23d::28) To CY8PR10MB6538.namprd10.prod.outlook.com (2603:10b6:930:5a::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB6538:EE_|CH3PR10MB6764:EE_ X-MS-Office365-Filtering-Correlation-Id: 05356cf4-79ae-43f5-15a4-08ddf22fccc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: SfIgL5qyTapSVqSIICtcAf6k0Sblv+1wFWEGdQsOhevUJCmEJSk6/LvCnpRTvfN6KMWFV16IzPqM4kN1Vwal09iPzccB9hVg8TGTf8hCwD9QaBn66GUuGql11qVsaRAMAywvh9tAm2QsxXAnxOkpLfTfcyziJs1e1Bum3/WxXfhdYoj/5ntl4s7/ZC7+YyINId1LPKZi5w7/D9DjjFbf4w6/iwQ2MZc4fSLfVtTtIFYGNp5cdpdq/PcTDYLQfNfi6oKb7CPwv8+rdmibiWOlFmwvC4NE/Mn1/8Rt1cmZj6ltKsDUw6ZKVWpUepIT0rXSIlLDrUj81H25Bk/SfVQ6WW4GIq9RX0U/iTh8CaYDmRKp1zvqpTqof2Vw416JOoqhzwwrb6JhtdMaaIpDSmwx1oJJY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; SRV:; IPV:NLI; SFV:NSPM; H:CY8PR10MB6538.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UsvGJXJpvkCK6hM6cB/Cdp+nkkW947juG7FbYLco7lrtq1+Zasy2QeoMkbXJL/UJGrEVmo1uDDiZIbzC7H/ucAyXNH7IwblW72K9l7w+Mab04jCLET/ITsWdDExRXooZmlZRJsg55B2XOrvGCwZd+/9wWOFX5ag0kqlbXIM+KECWlHuoRkMDuFGkf6v+iPeTupYSLQE0nMGZXkgfB4tjT9c5QD7ulSdTYW8R2ngF2nW32Ru2sY/AGryhUPPTidD2FHutSTxvP2FWEeU2LV+j2paYAJfdFZlRJJtTI/gqt8lOacU13FO9ZzrEPlwSeH6bivE8CVduWYp65Tb448zlNv/5zoQyxdVrwmljxcgEv8Hg4xLnPj6jz/bPxjYdgfH4mB16plgOlmB6R5NTyxGn6ulE5HfR/E2mUTLP36YmsbMXHCnJuFArl114r9GW2gQ+dF9QzoR9pvM7GkdG5TXDL8yPlo8Dhmh5HuxHIpeNr4oG3C54uTDlDwSdPemKuoFbfQWrlq+2QBHOp6VZ8Sjax6G2PVM5fol5EibVEEMymQqWZxtr0uy/fIp3d9FEMV81fjcvt8loAek7zXX7ildeAlnzUm3A7kuEBP54Nm99lrgY4BL68K0kO+DuRPKCaptSa3EbKIQR1dRC3onvukR/aQzUo4sLk/I9WyTEDfx1sjPAa5n7to++v+ZoGd/iTv5u+ml2AfVFKfDTmr0f/BTiIdmErftTFinrc6zTLoD7TGhAw9EQziwpCFwk2tlWTGEEdA8AskKkfaDjWo864KZLL/Uhvc/3TDd3TGd8kHn2rW03ZkO+NPQ4fBhdL+6lRd0CRcuzibOWEK2rRGckbHwRrINxfjtCmIRIm1VzYMyD5ZYc78Uf0u2CPHa8Tdqt2itxCI8kcGQ5jkiPF2Lp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wx2UClf32R/cvGtelCm9Tm529L/a/pu+h+uVodEi6Z1/32ZbuB+LEs9k+VXWUQn6vjF5qGy5ok4GCan4iHuHra+NDByJToR4CdGOqPRd4XpW2Ylqq745iIKJGXGYUoUay4swLG9IFkNYdoWl9GMUPobbfI7DVQcaR90ErRM7N8dg6tN9aKnYn8gLaDryySGynOfgIxefEVA6Jx5y53b4hjuafo8bsbJlteyLugldT4YeIA60Om2nnUHuksI1tGEJBrkHKZgcIJT1S6ufrnKzHLAGUXKn3fSWGCzh7rJncj0R0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05356cf4-79ae-43f5-15a4-08ddf22fccc4 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB6538.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2025 19:08:47.0645 (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: X18SLRjp2uNDBlQlnzi1pcuqdMNT+nMyR0B1kuc/Gr5OSoKVGthcTQ+lza1/ZCE3BlrxhXB9g6Jv0+q/EmrPvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6764 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-12_07,2025-09-12_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2508110000 definitions=main-2509120174 X-Authority-Analysis: v=2.4 cv=QeRmvtbv c=1 sm=1 tr=0 ts=68c46fc2 b=1 cx=c_pps a=zPCbziy225d3KhSqZt3L1A==:117 a=zPCbziy225d3KhSqZt3L1A==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=yJojWOMRYYMA:10 a=GoEa3M9JfhUA:10 a=ZShxYv_WDL4VyKXmmKkA:9 cc=ntf awl=host:12083 X-Proofpoint-ORIG-GUID: 35KYq8gwM0PFcTM2jftfUX17JjtG4kua X-Proofpoint-GUID: 35KYq8gwM0PFcTM2jftfUX17JjtG4kua X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1OCBTYWx0ZWRfXxdtHZxOyquR7 8Sl6PvwGrnOlXK3z76c1z3JvTZU4XrFSUrgsgD+hGpZ9GUXAahimQdEU6iFxEVogZzdM7uDiDG1 fUBXLMR6JVKr3mF0HPTg2viMhBd4wKcy1HV95JeZdloIm+DsrfnLtW8HuTpvA0qBxq+ZOyCKPZz YLv+JHQ4AZdamYt8KaMrJfTmlhnObOzCTobEDujaihbRbGQHyg0GKeZAFWco8tx2DrE/q+PEbtY QDYPQn0IC5qh8zpVUBE/ziKLExmhAu+TiPd4XDYVDIVx+OVEOHk7YLAgc0Fd3xDONYLn+OvKH3m H7r25uyh3RNV3sOsrnMfpaj3pw4MazyNGH2RzVPL6xO8OhMMK1AZFVmDhHpuvV5ppo9tsJ2pvuT IoA5DQievOctls0ROJtIfNVMTGqvwQ== X-Spam-Status: No, score=-11.3 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, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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~patchwork=sourceware.org@gcc.gnu.org |
| Series |
Fix SRA issue with -ftrivial-auto-var-init= [PR121894]
|
|
Commit Message
Qing Zhao
Sept. 12, 2025, 7:08 p.m. UTC
In tree-sra.cc, for the following stmt (initialization in source code):
s = {};
for the above lhs "s", the field "grp_assignment_write" of the created
struct access is 1;
however, for the following stmt (compiler added initialization):
s = .DEFERRED_INIT (size, init_type, &"s"[0]);
for the above lhs "s", the field "grp_assignment_write" of the created
struct access is 0;
Since the field "grp_assignment_write" of the struct access for the
corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT,
SRA phase didn't do a correct transformation for call to .DEFERRED_INIT.
To fix this issue, we should set the field "grp_assignment_write" correctly
for .DEFERRED_INIT.
PR 121894
gcc/ChangeLog:
* tree-sra.cc (scan_function): Set grp_assignment_write to 1 when
specially handle call to .DEFERRED_INIT.
gcc/testsuite/ChangeLog:
* g++.dg/auto-init-sra-pr121894.C: New test.
The patch is bootstrapping and regression testing on both x86 and aarch64,
Okay for committing if no issue?
Thanks.
Qing
---
gcc/testsuite/g++.dg/auto-init-sra-pr121894.C | 22 +++++++++++++++++++
gcc/tree-sra.cc | 8 ++++++-
2 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/g++.dg/auto-init-sra-pr121894.C
Comments
> On Sep 12, 2025, at 15:08, Qing Zhao <qing.zhao@oracle.com> wrote: > > In tree-sra.cc, for the following stmt (initialization in source code): > s = {}; > > for the above lhs "s", the field "grp_assignment_write" of the created > struct access is 1; > > however, for the following stmt (compiler added initialization): > s = .DEFERRED_INIT (size, init_type, &"s"[0]); > > for the above lhs "s", the field "grp_assignment_write" of the created > struct access is 0; > > Since the field "grp_assignment_write" of the struct access for the > corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT, > SRA phase didn't do a correct transformation for call to .DEFERRED_INIT. > > To fix this issue, we should set the field "grp_assignment_write" correctly > for .DEFERRED_INIT. > > PR 121894 > > gcc/ChangeLog: > > * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when > specially handle call to .DEFERRED_INIT. > > gcc/testsuite/ChangeLog: > > * g++.dg/auto-init-sra-pr121894.C: New test. > > The patch is bootstrapping and regression testing on both x86 and aarch64, Both bootstrap and regression testing succeed without any issue. Qing > Okay for committing if no issue? > > Thanks. > > Qing > > --- > gcc/testsuite/g++.dg/auto-init-sra-pr121894.C | 22 +++++++++++++++++++ > gcc/tree-sra.cc | 8 ++++++- > 2 files changed, 29 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > > diff --git a/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > new file mode 100644 > index 00000000000..b1e5a59ffe7 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > @@ -0,0 +1,22 @@ > +/* Verify that SRA total scalarization will not be confused by padding > + and also not confused by auto initialization. */ > +/* { dg-do compile } */ > +/* { dg-options "-O1 -fdump-tree-esra -ftrivial-auto-var-init=pattern" } */ > + > +struct S { int a, b, c, d; }; > +void bar (int, int, int, int); > + > +void > +foo () > +{ > + S s; > + s.a = 1; > + s.c = 2; > + s.d = 3; > + s.a++; > + s.c++; > + s.d++; > + bar (s.a, s.b, s.c, s.d); > +} > + > +/* { dg-final { scan-tree-dump-times "DEFERRED_INIT" 4 "esra" } } */ > diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc > index 921664ef470..cb0f518ff03 100644 > --- a/gcc/tree-sra.cc > +++ b/gcc/tree-sra.cc > @@ -1678,7 +1678,13 @@ scan_function (void) > /* If the STMT is a call to DEFERRED_INIT, avoid setting > cannot_scalarize_away_bitmap. */ > if (gimple_call_internal_p (stmt, IFN_DEFERRED_INIT)) > - ret |= !!build_access_from_expr_1 (t, stmt, true); > + { > + struct access *access > + = build_access_from_expr_1 (t, stmt, true); > + if (access) > + access->grp_assignment_write = 1; > + ret |= access != NULL; > + } > else > ret |= build_access_from_expr (t, stmt, true); > } > -- > 2.31.1 >
Hi, On Fri, Sep 12 2025, Qing Zhao wrote: > In tree-sra.cc, for the following stmt (initialization in source code): > s = {}; > > for the above lhs "s", the field "grp_assignment_write" of the created > struct access is 1; > > however, for the following stmt (compiler added initialization): > s = .DEFERRED_INIT (size, init_type, &"s"[0]); > > for the above lhs "s", the field "grp_assignment_write" of the created > struct access is 0; > > Since the field "grp_assignment_write" of the struct access for the > corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT, > SRA phase didn't do a correct transformation for call to .DEFERRED_INIT. > > To fix this issue, we should set the field "grp_assignment_write" correctly > for .DEFERRED_INIT. > > PR 121894 > > gcc/ChangeLog: > > * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when > specially handle call to .DEFERRED_INIT. > Thanks, I cannot approve the change but I think it makes sense. Martin > gcc/testsuite/ChangeLog: > > * g++.dg/auto-init-sra-pr121894.C: New test. > > The patch is bootstrapping and regression testing on both x86 and aarch64, > Okay for committing if no issue? > > Thanks. > > Qing > > --- > gcc/testsuite/g++.dg/auto-init-sra-pr121894.C | 22 +++++++++++++++++++ > gcc/tree-sra.cc | 8 ++++++- > 2 files changed, 29 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > > diff --git a/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > new file mode 100644 > index 00000000000..b1e5a59ffe7 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C > @@ -0,0 +1,22 @@ > +/* Verify that SRA total scalarization will not be confused by padding > + and also not confused by auto initialization. */ > +/* { dg-do compile } */ > +/* { dg-options "-O1 -fdump-tree-esra -ftrivial-auto-var-init=pattern" } */ > + > +struct S { int a, b, c, d; }; > +void bar (int, int, int, int); > + > +void > +foo () > +{ > + S s; > + s.a = 1; > + s.c = 2; > + s.d = 3; > + s.a++; > + s.c++; > + s.d++; > + bar (s.a, s.b, s.c, s.d); > +} > + > +/* { dg-final { scan-tree-dump-times "DEFERRED_INIT" 4 "esra" } } */ > diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc > index 921664ef470..cb0f518ff03 100644 > --- a/gcc/tree-sra.cc > +++ b/gcc/tree-sra.cc > @@ -1678,7 +1678,13 @@ scan_function (void) > /* If the STMT is a call to DEFERRED_INIT, avoid setting > cannot_scalarize_away_bitmap. */ > if (gimple_call_internal_p (stmt, IFN_DEFERRED_INIT)) > - ret |= !!build_access_from_expr_1 (t, stmt, true); > + { > + struct access *access > + = build_access_from_expr_1 (t, stmt, true); > + if (access) > + access->grp_assignment_write = 1; > + ret |= access != NULL; > + } > else > ret |= build_access_from_expr (t, stmt, true); > } > -- > 2.31.1
> On Sep 17, 2025, at 11:59, Martin Jambor <mjambor@suse.cz> wrote: > > Hi, > > On Fri, Sep 12 2025, Qing Zhao wrote: >> In tree-sra.cc, for the following stmt (initialization in source code): >> s = {}; >> >> for the above lhs "s", the field "grp_assignment_write" of the created >> struct access is 1; >> >> however, for the following stmt (compiler added initialization): >> s = .DEFERRED_INIT (size, init_type, &"s"[0]); >> >> for the above lhs "s", the field "grp_assignment_write" of the created >> struct access is 0; >> >> Since the field "grp_assignment_write" of the struct access for the >> corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT, >> SRA phase didn't do a correct transformation for call to .DEFERRED_INIT. >> >> To fix this issue, we should set the field "grp_assignment_write" correctly >> for .DEFERRED_INIT. >> >> PR 121894 >> >> gcc/ChangeLog: >> >> * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when >> specially handle call to .DEFERRED_INIT. >> > > Thanks, > > I cannot approve the change but I think it makes sense. Thank you for the review, Martin. Jakub, could you please also take a look at the change and let me know whether It’s good for committing? Thanks. Qing > > Martin > > > >> gcc/testsuite/ChangeLog: >> >> * g++.dg/auto-init-sra-pr121894.C: New test. >> >> The patch is bootstrapping and regression testing on both x86 and aarch64, >> Okay for committing if no issue? >> >> Thanks. >> >> Qing >> >> --- >> gcc/testsuite/g++.dg/auto-init-sra-pr121894.C | 22 +++++++++++++++++++ >> gcc/tree-sra.cc | 8 ++++++- >> 2 files changed, 29 insertions(+), 1 deletion(-) >> create mode 100644 gcc/testsuite/g++.dg/auto-init-sra-pr121894.C >> >> diff --git a/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C >> new file mode 100644 >> index 00000000000..b1e5a59ffe7 >> --- /dev/null >> +++ b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C >> @@ -0,0 +1,22 @@ >> +/* Verify that SRA total scalarization will not be confused by padding >> + and also not confused by auto initialization. */ >> +/* { dg-do compile } */ >> +/* { dg-options "-O1 -fdump-tree-esra -ftrivial-auto-var-init=pattern" } */ >> + >> +struct S { int a, b, c, d; }; >> +void bar (int, int, int, int); >> + >> +void >> +foo () >> +{ >> + S s; >> + s.a = 1; >> + s.c = 2; >> + s.d = 3; >> + s.a++; >> + s.c++; >> + s.d++; >> + bar (s.a, s.b, s.c, s.d); >> +} >> + >> +/* { dg-final { scan-tree-dump-times "DEFERRED_INIT" 4 "esra" } } */ >> diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc >> index 921664ef470..cb0f518ff03 100644 >> --- a/gcc/tree-sra.cc >> +++ b/gcc/tree-sra.cc >> @@ -1678,7 +1678,13 @@ scan_function (void) >> /* If the STMT is a call to DEFERRED_INIT, avoid setting >> cannot_scalarize_away_bitmap. */ >> if (gimple_call_internal_p (stmt, IFN_DEFERRED_INIT)) >> - ret |= !!build_access_from_expr_1 (t, stmt, true); >> + { >> + struct access *access >> + = build_access_from_expr_1 (t, stmt, true); >> + if (access) >> + access->grp_assignment_write = 1; >> + ret |= access != NULL; >> + } >> else >> ret |= build_access_from_expr (t, stmt, true); >> } >> -- >> 2.31.1
On Wed, Sep 17, 2025 at 05:59:34PM +0200, Martin Jambor wrote: > Hi, > > On Fri, Sep 12 2025, Qing Zhao wrote: > > In tree-sra.cc, for the following stmt (initialization in source code): > > s = {}; > > > > for the above lhs "s", the field "grp_assignment_write" of the created > > struct access is 1; > > > > however, for the following stmt (compiler added initialization): > > s = .DEFERRED_INIT (size, init_type, &"s"[0]); > > > > for the above lhs "s", the field "grp_assignment_write" of the created > > struct access is 0; > > > > Since the field "grp_assignment_write" of the struct access for the > > corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT, > > SRA phase didn't do a correct transformation for call to .DEFERRED_INIT. > > > > To fix this issue, we should set the field "grp_assignment_write" correctly > > for .DEFERRED_INIT. > > > > PR 121894 This should be PR tree-optimization/121894 > > > > gcc/ChangeLog: > > > > * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when > > specially handle call to .DEFERRED_INIT. > > I cannot approve the change but I think it makes sense. LGTM then with nits. > > gcc/testsuite/ChangeLog: > > > > * g++.dg/auto-init-sra-pr121894.C: New test. Please move the test into g++.dg/opt/ directory or g++.dg/tree-ssa/. g++.dg/ ideally shouldn't have any tests directly in it. Jakub
> On Sep 17, 2025, at 12:11, Jakub Jelinek <jakub@redhat.com> wrote: > > On Wed, Sep 17, 2025 at 05:59:34PM +0200, Martin Jambor wrote: >> Hi, >> >> On Fri, Sep 12 2025, Qing Zhao wrote: >>> In tree-sra.cc, for the following stmt (initialization in source code): >>> s = {}; >>> >>> for the above lhs "s", the field "grp_assignment_write" of the created >>> struct access is 1; >>> >>> however, for the following stmt (compiler added initialization): >>> s = .DEFERRED_INIT (size, init_type, &"s"[0]); >>> >>> for the above lhs "s", the field "grp_assignment_write" of the created >>> struct access is 0; >>> >>> Since the field "grp_assignment_write" of the struct access for the >>> corresponding LHS "s" is not set correctly when the RHS is .DEFERRED_INIT, >>> SRA phase didn't do a correct transformation for call to .DEFERRED_INIT. >>> >>> To fix this issue, we should set the field "grp_assignment_write" correctly >>> for .DEFERRED_INIT. >>> >>> PR 121894 > > This should be > PR tree-optimization/121894 Okay. > >>> >>> gcc/ChangeLog: >>> >>> * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when >>> specially handle call to .DEFERRED_INIT. >> >> I cannot approve the change but I think it makes sense. > > LGTM then with nits. > >>> gcc/testsuite/ChangeLog: >>> >>> * g++.dg/auto-init-sra-pr121894.C: New test. > > Please move the test into g++.dg/opt/ directory or g++.dg/tree-ssa/. > g++.dg/ ideally shouldn't have any tests directly in it. Sure, will do that before committing. thanks. Qing > > Jakub
diff --git a/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C new file mode 100644 index 00000000000..b1e5a59ffe7 --- /dev/null +++ b/gcc/testsuite/g++.dg/auto-init-sra-pr121894.C @@ -0,0 +1,22 @@ +/* Verify that SRA total scalarization will not be confused by padding + and also not confused by auto initialization. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-esra -ftrivial-auto-var-init=pattern" } */ + +struct S { int a, b, c, d; }; +void bar (int, int, int, int); + +void +foo () +{ + S s; + s.a = 1; + s.c = 2; + s.d = 3; + s.a++; + s.c++; + s.d++; + bar (s.a, s.b, s.c, s.d); +} + +/* { dg-final { scan-tree-dump-times "DEFERRED_INIT" 4 "esra" } } */ diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc index 921664ef470..cb0f518ff03 100644 --- a/gcc/tree-sra.cc +++ b/gcc/tree-sra.cc @@ -1678,7 +1678,13 @@ scan_function (void) /* If the STMT is a call to DEFERRED_INIT, avoid setting cannot_scalarize_away_bitmap. */ if (gimple_call_internal_p (stmt, IFN_DEFERRED_INIT)) - ret |= !!build_access_from_expr_1 (t, stmt, true); + { + struct access *access + = build_access_from_expr_1 (t, stmt, true); + if (access) + access->grp_assignment_write = 1; + ret |= access != NULL; + } else ret |= build_access_from_expr (t, stmt, true); }