From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 6DF3C3858D35; Fri, 15 Sep 2023 09:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DF3C3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-573f722b86eso1453547a12.1; Fri, 15 Sep 2023 02:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694769198; x=1695373998; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7sOBuXYw4/Vf1JXsTKtJCipQSfM0sFV94nG1RUnQeyo=; b=HI8pUaYfVZJFr/oDM0yiEm4Dum9JfhgSDlqSJidXKrc9CRDOY7jOW9eTvkV2AAZIb+ OOQF6OqHOB6K3yKadQOlm8m9zot9RLERLO+nL45RrSWwhQl1NwzRGfWMUybAAcg2i1wt fI2HqcYir5ym97OVz9eA8yfPLnPa8UzqTpA4NqUfHoh8Yad9WJiBpTRmcqDbc2w7tnu5 GqCKEBVMaPYAhkmoEaqMkuK9z6HpbpoAAK5z7IBHTjF1b5ublVML44p2UHJa4OrFn9WG NIfnIbfMkPIwKVfOiTWIApjiBQvjCnV/ISOGvC3WTWB4uDSgyQNxdSmQcL1W0ezxNfmO esBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694769198; x=1695373998; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7sOBuXYw4/Vf1JXsTKtJCipQSfM0sFV94nG1RUnQeyo=; b=Znh389r8oReOV2XYXD4LNWtK0wqwbGtDTojsxtA8V1L4SxLS1uxQyt3oYCIDGhBMit 1mQgzc5+byqPSV3KlMaBrKz8TZAez0cDsBlR1PHBOAK3jZQoO4eQQKScSozNjCliCwLb i1CdGEVLKaaLuM7dx7wjt3HTXB9rB4wFvlis9cDfTkdtRJL+cxvJ/ye8MfoIGAmPgn3U OfmNuTzKBNW/GRzqIaUCUik6i0OAMQZT+CfVQFVV2IarSNdBvOOs88z949qIXmRDzM53 SpKelNRY68PMOoCIG4hhpUOEn94FFT3quE14A68Sk+xq5ZGQUuXPpOxfR2UmZ5iZJG0B CeDA== X-Gm-Message-State: AOJu0YwJiRfZJ5y7r3a7r/0uDT5VdrLCUVanto7wp5wa6+pycOJZID11 muqMinjQBkIuhHRIAYTqBHTjZnqYNJ9hnLJEvLnUmhVi3mE= X-Google-Smtp-Source: AGHT+IE447TYDB/QLU295l7bjZ5J4gn+PQ2ADNpXlc6njsmOVgApDAEO6zJxIg3xuAcrZt8invDY2xOo0stwW4hZRmc= X-Received: by 2002:a17:90b:1e10:b0:268:4314:2dc6 with SMTP id pg16-20020a17090b1e1000b0026843142dc6mr880983pjb.37.1694769198160; Fri, 15 Sep 2023 02:13:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Fri, 15 Sep 2023 10:13:06 +0100 Message-ID: Subject: Re: [PATCH] Fortran: improve bounds-checking for array sections [PR30802] To: Harald Anlauf Cc: fortran , gcc-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: Hi Harald, The statement, in array_bound_check_elemental is redundant since the call is determined by a more restrictive condition. + if (!(gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)) + return; Apart from that, it looks good to me. OK for mainline. Thanks for the patch. Paul On Thu, 14 Sept 2023 at 21:22, Harald Anlauf via Fortran wrote: > > Dear all, > > array bounds checking was missing a few cases of array sections > that are handled via gfc_conv_expr_descriptor. Bounds checking > was done for the dimensions with ranges, but not for elemental > dimensions. > > The attached patch implements that and fixes pr30802 and also > pr97039, maybe a few more similar cases. > > Regtested on x86_64-pc-linux-gnu. OK for mainline? > > Thanks, > Harald >