From patchwork Tue Mar 22 20:05:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harald Anlauf X-Patchwork-Id: 1608331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=FVTMwuaM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KNMtn744jz9s0r for ; Wed, 23 Mar 2022 07:06:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C0753844079 for ; Tue, 22 Mar 2022 20:06:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C0753844079 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1647979566; bh=G7VM0O5YEqAy7Y1h2sS1Cxfq0o6FI9uLo0umDTYE0QY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FVTMwuaMHuf7DgoomIQAgWdGjRncrp6vXkETGKpBPaRACF+BUnJtAJlxeElFGarBo WkjU2+/dgajIBLMiLdFdiU0MJWPjP83xpk0VLAMNFG5hZnOVmam0bjLlvSLSwUqoDG A2AHU0582SCHiiZAT0/qDlHZgyLvnO4h3NKhK07w= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id 4FC903858D1E; Tue, 22 Mar 2022 20:05:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FC903858D1E X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [93.207.81.170] ([93.207.81.170]) by web-mail.gmx.net (3c-app-gmx-bap14.server.lan [172.19.172.84]) (via HTTP); Tue, 22 Mar 2022 21:05:05 +0100 MIME-Version: 1.0 Message-ID: To: fortran , gcc-patches Subject: [Committed] PR fortran/104999 - [12 Regression] runtime error: pointer index expression with base 0x00000cf67720 overflowed to 0xffffffffea627728 Date: Tue, 22 Mar 2022 21:05:05 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:d15rKE7urrk5nhh8pDqs3qgFI2z+u9dWeZlxxnLdTjDRmrnZKB1wrQYrNx+8kvxm3i2Tj ai3P0ddOII1HyzReYwxPwYE8V/WSkuDXZHU+JMXc8+QmsqIATDH7kMP6rH8oAM+i49erIzUskYOb oJU5zvQmWGFny/iiWIeojjVLJsiwYXAtPH2VUyORmgADKDpLlHMK2Hal4aFQa71HduUgBJXEXrer 3b5dHd6YIzwo+JT/5zhgcmygtUI7a/2eZSvQv8PTAomRegDRPzCxNaCmSukwN5GFrQrSyVOH1X1J zk= X-UI-Out-Filterresults: notjunk:1;V03:K0:KTYY0491C6Q=:NC+cG9aKP8hqVnnPiVEM3m iTG1Uu+RQDyNqyS02IEavmi1LXz2w90Aw6eKHGxuLalOAAClU+GYX5kO5RRWNy1OXm5UCQe/+ U1fn8fXajlySjnHxrZJfNp6+NTy93NIOCvRD904XGo9KqvPPTj+Z0WcBCw5vTc+MhC2kCTVQh Un82iI7zP3xqcIJyCARYj5El26SqPuab1pj7SsLFIXeKpax+Mzgvu2DupQz5XebK81o3H9on7 BYzlf7WUKZKz5y6d6yGJbO6XZ7GnFXIl9sFDXj3D6Iw8Ykbgc7NhXWdj9jT84FcJTUOx41Khu JhdSM+YjagR+drAl0Cmwp4P1/pusUEXQMj7la7cZd8nYN1fl1HewjcJw7AODuS2zMaNXo8OiS VQvZ5uJ2AAtL/s0YZO9MUHSgA+LgaJGW1omqxSKaKEjCHUC8vzqDMgtPQ3bSDtGyWzWjxiaoh EnzY7Urg0K17uT0TJ/i3cd8N+R7kXjBWBA+9RmmlRY/hXDeYH5KWiw19Jzpa9WXh7u3nkQq3x YTsoJexYsxQdAQZ0Bh85wm2fEWr94rPKVrVykVB5KAW6a5Pl7x/sdiRkxD5CBSnpDMG9BY8QO wUbd99yybrf0Lwi/S1RuupC0QRUKCTDZJrE0LAjOGUiSOU0DmzMbOEMcNNa33LSktg1NiKt9S PgC1HGeu3h3s8suDa0H6+AkKYwgPDirM5JSCHia63oiruEEeZFxzX6uEXIVwaTCc3FQMggLOr 9dq2eLyCGRVeaGU7dYlljgNWQaYRLJaGUxWKk0Jkg9pzJZjsvT7N3RIC+zKHfnbkQHDdw87u6 juwqfdZ X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Harald Anlauf via Gcc-patches From: Harald Anlauf Reply-To: Harald Anlauf Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Dear all, as reported by Martin Liška, a sanitized compiler hits an uninitialized stride value when simplifying CSHIFT in testcase gfortran.dg/simplify_cshift_1.f90. Committed as obvious after confirmation in the PR by Martin that the attached patch fixes the issue. commit r12-7771-g774ab2edcb5f3a24ed3a5cffd1143bd49a69f1ee Thanks, Harald From 774ab2edcb5f3a24ed3a5cffd1143bd49a69f1ee Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Tue, 22 Mar 2022 20:54:18 +0100 Subject: [PATCH] Fortran: ensure intialization of stride array gcc/fortran/ChangeLog: PR fortran/104999 * simplify.cc (gfc_simplify_cshift): Ensure temporary holding source array stride is initialized. --- gcc/fortran/simplify.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc index 0c15bcb2b0a..233cc42137f 100644 --- a/gcc/fortran/simplify.cc +++ b/gcc/fortran/simplify.cc @@ -2134,6 +2134,7 @@ gfc_simplify_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim) resultvec = XCNEWVEC (gfc_expr *, arraysize); + sstride[0] = 0; extent[0] = 1; count[0] = 0; -- 2.34.1