Message ID | SJ2PR01MB863509CEB9A5B18AD42D986EE12EA@SJ2PR01MB8635.prod.exchangelabs.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1070224vqx; Tue, 4 Jul 2023 01:51:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhVQBKZAQRhCmD6XvJPek1gIaXTI1CYdWgNxgvDd4dbRQZyRtAAtDWK4a6hEMLthVSlZP0 X-Received: by 2002:a17:906:854c:b0:8b1:7de3:cfaa with SMTP id h12-20020a170906854c00b008b17de3cfaamr9780511ejy.3.1688460711341; Tue, 04 Jul 2023 01:51:51 -0700 (PDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id jp15-20020a170906f74f00b0099317635beesi4298286ejb.470.2023.07.04.01.51.51 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 01:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HKxvtulI; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E9BD385771F for <ouuuleilei@gmail.com>; Tue, 4 Jul 2023 08:51:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E9BD385771F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688460710; bh=6ackLcq7MNaaQ661IbC6UFqojGsoZVwvc3nYlngeeiM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=HKxvtulI2uJBdt2q3SvpVe9dnWpqs3060Jw7PqPKtnTsHvwbBI7lN8CL02noPBwUu ERgadifpK8wfQC7/IHbCmtfhFj/7lMnYoLAa3D7qo+o1cBKKm0cTbYSNMeBlaXpEyV kufBpAuFn7Ftyv3iRBnpgAovZ9/n5o5LFr9uJIaA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2134.outbound.protection.outlook.com [40.107.243.134]) by sourceware.org (Postfix) with ESMTPS id 3BCB93858D35 for <gcc-patches@gcc.gnu.org>; Tue, 4 Jul 2023 08:51:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BCB93858D35 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jpd+aXX0oZgWgAJy5a8YcizW0rxYvbBSuzcbTpBVlU9yHtcCKx9EEDL2yq38NT9px53+fxO2Tk2KRPQaWZUkO28Eh/w07Wf8JZ4dH0m9LMVNJlTR6J8bAhfnoxL5vEKooRyF5XuT3gpMz51QgNneOvo07u6ZC1Fxrq4rJx3RfOmG1YJaLxyTpcNSd4Iu5RHjglkeQ3bR+ot6AJjh8tzNq8faSz1THZPj/ia3NKXup1jJouQ4+4EG168yUh9LGEfGkKUi5tMzUHCmpCuTTgFGK2V4gQHd6yw/wt27lAn/04xEAFjyZ1T8elNnK+6BHjDeojTtV+giIa1RVdUD7lYjvQ== 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=6ackLcq7MNaaQ661IbC6UFqojGsoZVwvc3nYlngeeiM=; b=FJrVPjYRZju4x/1D9vUL1RoG8vkKZuyaOWSL4boWyrQvIWdQTLboMkx08P45v9RbqyWgE6eyiZkXmEk3jDC2tsFO35rLZPIe6Xw1IprxcAH8+yXO651rbD5kFiyqv3fIQaZ2/cza96YpCCdy9DiNpni3DC3rImLrtWo7XyH1lcO8ejlipAwMr0nVppbTXzQ4u0N9j+Jr7rOG2CMKwRdKRapOp8jZK25XOL7Q2+vxPftQbmFhRFExBmRO4wEdsJn9ZdXDO3+DH1b2pwT/YHa3uU4v/rWu0F396j+fwXFqxBlE8v5lpNZ+mrvZ0uxeUIcM+sMyLON7xWgDegZv2JnPsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none Received: from SJ2PR01MB8635.prod.exchangelabs.com (2603:10b6:a03:57b::16) by BN0PR01MB7184.prod.exchangelabs.com (2603:10b6:408:15b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 08:51:01 +0000 Received: from SJ2PR01MB8635.prod.exchangelabs.com ([fe80::79da:7b34:639e:b255]) by SJ2PR01MB8635.prod.exchangelabs.com ([fe80::79da:7b34:639e:b255%6]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 08:51:00 +0000 To: "GCC-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> Subject: [PATCH] Vect: avoid using uninitialized variable (PR tree-optimization/110531) Thread-Topic: [PATCH] Vect: avoid using uninitialized variable (PR tree-optimization/110531) Thread-Index: AQHZrlQMC80FY83KwEGuAw8hf2AYrQ== Date: Tue, 4 Jul 2023 08:51:00 +0000 Message-ID: <SJ2PR01MB863509CEB9A5B18AD42D986EE12EA@SJ2PR01MB8635.prod.exchangelabs.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=True; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SetDate=2023-07-04T08:50:59.163Z; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Name=Confidential; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Method=Standard; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ2PR01MB8635:EE_|BN0PR01MB7184:EE_ x-ms-office365-filtering-correlation-id: 2ae36e03-c9cb-4030-2260-08db7c6bcaa2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O5OykyfWK9TJAMdTaGmJcabl5vVnGIN6yElUtHHj3d1cG7gimx5Jqckn7p3Ddwc2bTmeonTB9wUAqjR2uk4b0AVT9wVpNSN6DQhL5WP5hAO8Ba+U+BHk0c5WfPlceno/jkGo+M6+xshWqIjPS85yB1YomLNS2YO2CUqIF7WDTLTOub/b/E59cTRPYfg1ZVVzBSHBnhAIggX7AnNj4loaS5P3NSeUPpYk4ePg772vB3SgqOYOfj0pit1/WwVjqgihILM2zPnBE0o0VHYBMKdCmkIG2GI1Yobmo87FqDY7ddBGv8pynHR4D7EppfPt+JAPpvBWNq55udlbVnLkmXuCLqw9fnZ8A5MC7dvVEv/60FnAYHSebz1ChVdiWHNPi5sO88qFmfa9Zi3JSA31TWakKeY8JQXk1DOoV/rLbRJlYcFd9wj86QE1YMHqke28gGsIoF+yN9PzobQ4u51N+SvzjEt8V3cODak2v/BM0gFGDn5KzjJD4IR852vHQyp5sUCImoMxEilgCJVSvDfEhePJi7rc7tPLmpcAwuiGjmeEjKr2F4kfduqaXjVRdx/+MUnDEmAUo1CPf8mN7sNzPNmBuJ61f5tgkIfleTFIvkN0lT6uBNma1xEiAYU53rSJvtlW x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR01MB8635.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(33656002)(66446008)(66946007)(91956017)(66556008)(6916009)(66476007)(76116006)(64756008)(2906002)(478600001)(316002)(8936002)(8676002)(52536014)(5660300002)(41300700001)(55016003)(9686003)(86362001)(38070700005)(38100700002)(4744005)(7696005)(26005)(186003)(6506007)(71200400001)(122000001)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?AoAD+aIQ0F+TRo5t7j9GKAe?= =?iso-8859-1?q?l/FErm1og3NB4AddXmBAASc8gJlBpocfo2y3Kpee059shaRqhW6XCqhbnM7c?= =?iso-8859-1?q?f24nl2R96iIAq4U1o71Ww9ydRMGE21lL1V2lke/GP88EPyH567vPNk3v6rA9?= =?iso-8859-1?q?nPoGg/Ni0VKMG9JGwXeHU/CjIkzChqDpftPJcbaK1ewu0NNU0aOqiw5kzMaj?= =?iso-8859-1?q?KC7wXIQv2cRnI0otf/6ZnQ96eMPLkBTKEJoNjskeGixhtR9NqLPF840qWVvY?= =?iso-8859-1?q?ubMcN/9VvYGsk5AAyXz4VWy5vFXh2nyras6ff4dryUCaoJqqA03494ND8xLd?= =?iso-8859-1?q?QTxX3udWJgbxRc11RFAnv+zCDb5ssYK0LDx0UiztDm0HnoUM9FBnP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/bPowcj1C38+CfFhD0mJsWFa9CeaXe5cSIwsqjv0Wt0M2a/u9Un+43q/?= =?iso-8859-1?q?eD19ShSrfEkRmLxfDHVKg+DguGJMi3W7mXWrFedSs40/tbIS4/JV0dYF3e2N?= =?iso-8859-1?q?TUqGaUeyqsaoyhUGH8KGum5xHFwzwbVfP0nFzlq92LGm9PWXIyF9SxJ8k3Uy?= =?iso-8859-1?q?wSoIB0Ux2zZdADyQLbVeFvRe2sGLJAevDc9QT1rS05WeVc2fJfm356CTGQIn?= =?iso-8859-1?q?Mm4i5X4xrynZC1g1LBAjyzN1y+R7/exPD6STJxZV5Qdh934Z4w7JHr+VBRuF?= =?iso-8859-1?q?7XoBxPpqiQkRxHc2hemp4w5+otiR3WsZmonXUw0p0fip6fum6tFy+cqer6Yp?= =?iso-8859-1?q?PyKkopzKmLVglKbBke4uUqxAvy/FgAXAqbcK0Sg=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8635.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ae36e03-c9cb-4030-2260-08db7c6bcaa2 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2023 08:51:00.5687 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QAQPU4dzQo6U18rYicKGJxH3MTxYCsw827e8uPYBCzAbm62Dr06BNuWekbIDsU1ea4EuTxyVEHcI+ESlLm9VURDhhZ7UrB5NQIx2sthiNfzCrsLUDLW9taHjyQEv40xL X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB7184 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 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> From: Hao Liu OS via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Hao Liu OS <hliu@os.amperecomputing.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770479378822988174?= X-GMAIL-MSGID: =?utf-8?q?1770479378822988174?= |
Series |
Vect: avoid using uninitialized variable (PR tree-optimization/110531)
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Hao Liu OS
July 4, 2023, 8:51 a.m. UTC
slp_done_for_suggested_uf is used in vect_analyze_loop_2 without initialization, which is undefined behavior. Initialize it to false according to the discussion. gcc/ChangeLog: PR tree-optimization/110531 * tree-vect-loop.cc (vect_analyze_loop_1): initialize slp_done_for_suggested_uf to false. --- gcc/tree-vect-loop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Jul 4, 2023 at 10:51 AM Hao Liu OS via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > slp_done_for_suggested_uf is used in vect_analyze_loop_2 without > initialization, which is undefined behavior. Initialize it to false > according to the discussion. OK > gcc/ChangeLog: > PR tree-optimization/110531 > * tree-vect-loop.cc (vect_analyze_loop_1): initialize > slp_done_for_suggested_uf to false. > --- > gcc/tree-vect-loop.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index f39a1ecb306..e504645f1df 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -3333,7 +3333,7 @@ vect_analyze_loop_1 (class loop *loop, vec_info_shared *shared, > machine_mode vector_mode = vector_modes[mode_i]; > loop_vinfo->vector_mode = vector_mode; > unsigned int suggested_unroll_factor = 1; > - bool slp_done_for_suggested_uf; > + bool slp_done_for_suggested_uf = false; > > /* Run the main analysis. */ > opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal, > -- > 2.34.1
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index f39a1ecb306..e504645f1df 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -3333,7 +3333,7 @@ vect_analyze_loop_1 (class loop *loop, vec_info_shared *shared, machine_mode vector_mode = vector_modes[mode_i]; loop_vinfo->vector_mode = vector_mode; unsigned int suggested_unroll_factor = 1; - bool slp_done_for_suggested_uf; + bool slp_done_for_suggested_uf = false; /* Run the main analysis. */ opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal,