From patchwork Tue Nov 7 10:24:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 162437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp181294vqo; Tue, 7 Nov 2023 04:00:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtoMV9nkV1RA5B/w0PCiqr7TWEjkVxznDahrG48NJZfjwxmysOGCT/Oi0v1OscgE3b03/+ X-Received: by 2002:a05:622a:2ca:b0:41e:ae5a:2b96 with SMTP id a10-20020a05622a02ca00b0041eae5a2b96mr9871112qtx.13.1699358439997; Tue, 07 Nov 2023 04:00:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699358439; cv=pass; d=google.com; s=arc-20160816; b=UQT6ZmNkFI8b+mrCEw0r0XvxrJn/pco+Zr/lEhEbPH68KZrPtHpazUFyjHgThoXUKU ZiYB6gfxwQ4T73D7ilEoiQv08TyGMeEl8BwK8Vyq2VpFaWMub1aEe8kKMR4CnQ08MimP 6DR7ngHuxsmxXexY5NsqCsStSJAZ0gEThtntw15DO8ddE9xPI2yL/GCGuKAT6+rovLBy uvMr0MYWHbw4bNsOluM1Ehv3ICr4ZP5FzZkcIQTSB2SteNfiKVloTBTGg9lrvkTCo1WU ISNbn0QUMhTqv2xhs/yzQUfcCpn9Q8T85umjLNDbGoex/+RkVz/Xkbn8gjShHMmf80/a nvTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=jcKbOWZcIYKUgSVtR//5mrtbLgTMjPGA9BwQlzWDtdI=; fh=zSP9Z/xOHj5SuUPPVSStTox2VGm+p0Uo644NtF/AZic=; b=FwGcmKxY63qxMqat2VwlWs+hm5AIVjn5rARij5RMVdv9EeODykeYeNPMVM8ll0Ir0z RIr2Y3Fyjwu87b5WeTYTWq/WfSg8DADKQ7+4z5F/V62/9GoxLydOITchdRjEOQKeuMFs yr9pkKbzhWabPqh0ViNN99jvburivZmAmKNZNZuobi0sSg8eglsmUhcYwRpUtBMrG46y etrJw+WBZkTx8IETvYc2yqRHrDhEfl4gx6rzUFOC6nVjf4jAJVtQa3ziGIXddlidkooZ uIG0Aiw4yUtgkoBEMS4xfxd45l9GKQ4DXuqiYE3awuK9whIbRuZvOOPG9JRop6QPokFj oLsg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=M5ugpD1t; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ZO2PNqXk; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e21-20020ac84e55000000b004180387dcc0si6676688qtw.605.2023.11.07.04.00.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 04:00:39 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=M5ugpD1t; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ZO2PNqXk; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 6AD8E388204F for ; Tue, 7 Nov 2023 10:25:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD8E388204F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699352719; bh=jcKbOWZcIYKUgSVtR//5mrtbLgTMjPGA9BwQlzWDtdI=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M5ugpD1tO08QG/soX+oLATk+wFgiBQlb3bOtHohoQcz8NcM9zYg3SHsI1thrn0dmQ 79UCA+ij5SmzOXrlFGjv3wmH+p/ikjPLE+DDUGg4bwnkEHl3aaRgce7P9cLHdpXBv0 vGRXsElMLpdQ+nUGtOpwI1WeqD2Hi9kX3DSCsvrg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) by sourceware.org (Postfix) with ESMTPS id 5D886386545A for ; Tue, 7 Nov 2023 10:24:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D886386545A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gcc.gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D886386545A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=80.12.242.29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352659; cv=none; b=H39HtNH4mwKl2FWW/2qwinA2tCz11oM8v2vJbFTuKvnMsDn3XOZiKeTUsyCXbrDt6IN1sHbJmR+kfU8V9Si006FBDjNx18tqN3gJoGVyizqo7INGAjpWGbV8jtDaoZgVrc7OsEytpoU1Vbny+Ot1Pjz87uMzpUlyPdh/0jEmJPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352659; c=relaxed/simple; bh=kHpbUZ+mT32cUYvlVacNt08M8O4IviTLwUs5WH8axfs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lET5zVmrpUsf3GRXZcv7vKrpH2ra3pKpxTBWd6KbGC4Z9qy2YMTSm0xIJfM0KgKnpCRU1l1j8NCl76nYZJ0pBlmwhf/0nDNnFNo911uaAdd1xpEODC+/yRctPHmVS5E3A2PuYFSLlfk81M8fNqiXbrpolikWWi8+bz6TE//i8Zs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from cyrano.home ([86.215.161.51]) by smtp.orange.fr with ESMTPA id 0JFcrynXNF6ta0JFjrgDCw; Tue, 07 Nov 2023 11:24:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1699352651; bh=jcKbOWZcIYKUgSVtR//5mrtbLgTMjPGA9BwQlzWDtdI=; h=From:To:Subject:Date:In-Reply-To:References; b=ZO2PNqXkxuIn4qB4GaHGjfTfrqFm+K3oKlWAsajZUNQbQRH4cxS9JvFwHNgY0W/iR 5CmyP4Mn+pyzAsb2veJUk9orIzA1/YSLvQ/zWxh5G3Te5TF5+RVoQO5f4ZAe4dKfT+ lgd7NIn49rX03dra4qbxKsOtl+Dxfvn/9il7zAS09Y05LcmrdkPP+TXFlchTS+8arM BMpdOVzXqGag0nsesXlGKgKlcmaZwS6OPHhdc5vV3xjn2SyOYFtZ/+zD5xp7ambOxu N2mFjZWSrc6fc9eQWL7d+taQOPsRGzcsPbEZKj0gWuy6WlTRCHybSRh4869jAiQjE4 ZwOm+df7kJcJA== X-ME-Helo: cyrano.home X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Tue, 07 Nov 2023 11:24:11 +0100 X-ME-IP: 86.215.161.51 From: Mikael Morin To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH v2 2/3] libgfortran: Remove early return if extent is zero [PR112371] Date: Tue, 7 Nov 2023 11:24:03 +0100 Message-ID: <20231107102404.1723120-3-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231107102404.1723120-1-mikael@gcc.gnu.org> References: <20231107102404.1723120-1-mikael@gcc.gnu.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781906475926745044 X-GMAIL-MSGID: 1781906475926745044 Remove the early return present in function templates for transformational functions doing a (masked) reduction of an array along a dimension. This early return, which triggered if the extent in the reduction dimension was zero, was wrong because even if the reduction operation degenerates to a constant value in that case, one has to loop anyway along the other dimensions to initialize every element of the resulting array with that constant value. The case of negative extent (not sure whether it may happen in practice) which was also early returning, is handled by clamping to zero. The offending piece of code was present in several places, and this removes them all. Namely, the impacted m4 files are ifunction.m4 for regular functions and types, ifunction-s.m4 for character minloc and maxloc, and ifunction-s2.m4 for character minval and maxval. PR fortran/112371 libgfortran/ChangeLog: * m4/ifunction.m4 (START_MASKED_ARRAY_FUNCTION): Remove early return if extent is zero or less, and clamp negative value to zero. * m4/ifunction-s.m4 (START_MASKED_ARRAY_FUNCTION): Ditto. * m4/ifunction-s2.m4 (START_MASKED_ARRAY_FUNCTION): Ditto. * generated/iall_i1.c: Regenerate. * generated/iall_i16.c: Regenerate. * generated/iall_i2.c: Regenerate. * generated/iall_i4.c: Regenerate. * generated/iall_i8.c: Regenerate. * generated/iany_i1.c: Regenerate. * generated/iany_i16.c: Regenerate. * generated/iany_i2.c: Regenerate. * generated/iany_i4.c: Regenerate. * generated/iany_i8.c: Regenerate. * generated/iparity_i1.c: Regenerate. * generated/iparity_i16.c: Regenerate. * generated/iparity_i2.c: Regenerate. * generated/iparity_i4.c: Regenerate. * generated/iparity_i8.c: Regenerate. * generated/maxloc1_16_i1.c: Regenerate. * generated/maxloc1_16_i16.c: Regenerate. * generated/maxloc1_16_i2.c: Regenerate. * generated/maxloc1_16_i4.c: Regenerate. * generated/maxloc1_16_i8.c: Regenerate. * generated/maxloc1_16_r10.c: Regenerate. * generated/maxloc1_16_r16.c: Regenerate. * generated/maxloc1_16_r17.c: Regenerate. * generated/maxloc1_16_r4.c: Regenerate. * generated/maxloc1_16_r8.c: Regenerate. * generated/maxloc1_16_s1.c: Regenerate. * generated/maxloc1_16_s4.c: Regenerate. * generated/maxloc1_4_i1.c: Regenerate. * generated/maxloc1_4_i16.c: Regenerate. * generated/maxloc1_4_i2.c: Regenerate. * generated/maxloc1_4_i4.c: Regenerate. * generated/maxloc1_4_i8.c: Regenerate. * generated/maxloc1_4_r10.c: Regenerate. * generated/maxloc1_4_r16.c: Regenerate. * generated/maxloc1_4_r17.c: Regenerate. * generated/maxloc1_4_r4.c: Regenerate. * generated/maxloc1_4_r8.c: Regenerate. * generated/maxloc1_4_s1.c: Regenerate. * generated/maxloc1_4_s4.c: Regenerate. * generated/maxloc1_8_i1.c: Regenerate. * generated/maxloc1_8_i16.c: Regenerate. * generated/maxloc1_8_i2.c: Regenerate. * generated/maxloc1_8_i4.c: Regenerate. * generated/maxloc1_8_i8.c: Regenerate. * generated/maxloc1_8_r10.c: Regenerate. * generated/maxloc1_8_r16.c: Regenerate. * generated/maxloc1_8_r17.c: Regenerate. * generated/maxloc1_8_r4.c: Regenerate. * generated/maxloc1_8_r8.c: Regenerate. * generated/maxloc1_8_s1.c: Regenerate. * generated/maxloc1_8_s4.c: Regenerate. * generated/maxval1_s1.c: Regenerate. * generated/maxval1_s4.c: Regenerate. * generated/maxval_i1.c: Regenerate. * generated/maxval_i16.c: Regenerate. * generated/maxval_i2.c: Regenerate. * generated/maxval_i4.c: Regenerate. * generated/maxval_i8.c: Regenerate. * generated/maxval_r10.c: Regenerate. * generated/maxval_r16.c: Regenerate. * generated/maxval_r17.c: Regenerate. * generated/maxval_r4.c: Regenerate. * generated/maxval_r8.c: Regenerate. * generated/minloc1_16_i1.c: Regenerate. * generated/minloc1_16_i16.c: Regenerate. * generated/minloc1_16_i2.c: Regenerate. * generated/minloc1_16_i4.c: Regenerate. * generated/minloc1_16_i8.c: Regenerate. * generated/minloc1_16_r10.c: Regenerate. * generated/minloc1_16_r16.c: Regenerate. * generated/minloc1_16_r17.c: Regenerate. * generated/minloc1_16_r4.c: Regenerate. * generated/minloc1_16_r8.c: Regenerate. * generated/minloc1_16_s1.c: Regenerate. * generated/minloc1_16_s4.c: Regenerate. * generated/minloc1_4_i1.c: Regenerate. * generated/minloc1_4_i16.c: Regenerate. * generated/minloc1_4_i2.c: Regenerate. * generated/minloc1_4_i4.c: Regenerate. * generated/minloc1_4_i8.c: Regenerate. * generated/minloc1_4_r10.c: Regenerate. * generated/minloc1_4_r16.c: Regenerate. * generated/minloc1_4_r17.c: Regenerate. * generated/minloc1_4_r4.c: Regenerate. * generated/minloc1_4_r8.c: Regenerate. * generated/minloc1_4_s1.c: Regenerate. * generated/minloc1_4_s4.c: Regenerate. * generated/minloc1_8_i1.c: Regenerate. * generated/minloc1_8_i16.c: Regenerate. * generated/minloc1_8_i2.c: Regenerate. * generated/minloc1_8_i4.c: Regenerate. * generated/minloc1_8_i8.c: Regenerate. * generated/minloc1_8_r10.c: Regenerate. * generated/minloc1_8_r16.c: Regenerate. * generated/minloc1_8_r17.c: Regenerate. * generated/minloc1_8_r4.c: Regenerate. * generated/minloc1_8_r8.c: Regenerate. * generated/minloc1_8_s1.c: Regenerate. * generated/minloc1_8_s4.c: Regenerate. * generated/minval1_s1.c: Regenerate. * generated/minval1_s4.c: Regenerate. * generated/minval_i1.c: Regenerate. * generated/minval_i16.c: Regenerate. * generated/minval_i2.c: Regenerate. * generated/minval_i4.c: Regenerate. * generated/minval_i8.c: Regenerate. * generated/minval_r10.c: Regenerate. * generated/minval_r16.c: Regenerate. * generated/minval_r17.c: Regenerate. * generated/minval_r4.c: Regenerate. * generated/minval_r8.c: Regenerate. * generated/product_c10.c: Regenerate. * generated/product_c16.c: Regenerate. * generated/product_c17.c: Regenerate. * generated/product_c4.c: Regenerate. * generated/product_c8.c: Regenerate. * generated/product_i1.c: Regenerate. * generated/product_i16.c: Regenerate. * generated/product_i2.c: Regenerate. * generated/product_i4.c: Regenerate. * generated/product_i8.c: Regenerate. * generated/product_r10.c: Regenerate. * generated/product_r16.c: Regenerate. * generated/product_r17.c: Regenerate. * generated/product_r4.c: Regenerate. * generated/product_r8.c: Regenerate. * generated/sum_c10.c: Regenerate. * generated/sum_c16.c: Regenerate. * generated/sum_c17.c: Regenerate. * generated/sum_c4.c: Regenerate. * generated/sum_c8.c: Regenerate. * generated/sum_i1.c: Regenerate. * generated/sum_i16.c: Regenerate. * generated/sum_i2.c: Regenerate. * generated/sum_i4.c: Regenerate. * generated/sum_i8.c: Regenerate. * generated/sum_r10.c: Regenerate. * generated/sum_r16.c: Regenerate. * generated/sum_r17.c: Regenerate. * generated/sum_r4.c: Regenerate. * generated/sum_r8.c: Regenerate. gcc/testsuite/ChangeLog: * gfortran.dg/bound_10.f90: New test. --- gcc/testsuite/gfortran.dg/bound_10.f90 | 207 +++++++++++++++++++++++++ libgfortran/generated/iall_i1.c | 4 +- libgfortran/generated/iall_i16.c | 4 +- libgfortran/generated/iall_i2.c | 4 +- libgfortran/generated/iall_i4.c | 4 +- libgfortran/generated/iall_i8.c | 4 +- libgfortran/generated/iany_i1.c | 4 +- libgfortran/generated/iany_i16.c | 4 +- libgfortran/generated/iany_i2.c | 4 +- libgfortran/generated/iany_i4.c | 4 +- libgfortran/generated/iany_i8.c | 4 +- libgfortran/generated/iparity_i1.c | 4 +- libgfortran/generated/iparity_i16.c | 4 +- libgfortran/generated/iparity_i2.c | 4 +- libgfortran/generated/iparity_i4.c | 4 +- libgfortran/generated/iparity_i8.c | 4 +- libgfortran/generated/maxloc1_16_i1.c | 4 +- libgfortran/generated/maxloc1_16_i16.c | 4 +- libgfortran/generated/maxloc1_16_i2.c | 4 +- libgfortran/generated/maxloc1_16_i4.c | 4 +- libgfortran/generated/maxloc1_16_i8.c | 4 +- libgfortran/generated/maxloc1_16_r10.c | 4 +- libgfortran/generated/maxloc1_16_r16.c | 4 +- libgfortran/generated/maxloc1_16_r17.c | 4 +- libgfortran/generated/maxloc1_16_r4.c | 4 +- libgfortran/generated/maxloc1_16_r8.c | 4 +- libgfortran/generated/maxloc1_16_s1.c | 4 +- libgfortran/generated/maxloc1_16_s4.c | 4 +- libgfortran/generated/maxloc1_4_i1.c | 4 +- libgfortran/generated/maxloc1_4_i16.c | 4 +- libgfortran/generated/maxloc1_4_i2.c | 4 +- libgfortran/generated/maxloc1_4_i4.c | 4 +- libgfortran/generated/maxloc1_4_i8.c | 4 +- libgfortran/generated/maxloc1_4_r10.c | 4 +- libgfortran/generated/maxloc1_4_r16.c | 4 +- libgfortran/generated/maxloc1_4_r17.c | 4 +- libgfortran/generated/maxloc1_4_r4.c | 4 +- libgfortran/generated/maxloc1_4_r8.c | 4 +- libgfortran/generated/maxloc1_4_s1.c | 4 +- libgfortran/generated/maxloc1_4_s4.c | 4 +- libgfortran/generated/maxloc1_8_i1.c | 4 +- libgfortran/generated/maxloc1_8_i16.c | 4 +- libgfortran/generated/maxloc1_8_i2.c | 4 +- libgfortran/generated/maxloc1_8_i4.c | 4 +- libgfortran/generated/maxloc1_8_i8.c | 4 +- libgfortran/generated/maxloc1_8_r10.c | 4 +- libgfortran/generated/maxloc1_8_r16.c | 4 +- libgfortran/generated/maxloc1_8_r17.c | 4 +- libgfortran/generated/maxloc1_8_r4.c | 4 +- libgfortran/generated/maxloc1_8_r8.c | 4 +- libgfortran/generated/maxloc1_8_s1.c | 4 +- libgfortran/generated/maxloc1_8_s4.c | 4 +- libgfortran/generated/maxval1_s1.c | 4 +- libgfortran/generated/maxval1_s4.c | 4 +- libgfortran/generated/maxval_i1.c | 4 +- libgfortran/generated/maxval_i16.c | 4 +- libgfortran/generated/maxval_i2.c | 4 +- libgfortran/generated/maxval_i4.c | 4 +- libgfortran/generated/maxval_i8.c | 4 +- libgfortran/generated/maxval_r10.c | 4 +- libgfortran/generated/maxval_r16.c | 4 +- libgfortran/generated/maxval_r17.c | 4 +- libgfortran/generated/maxval_r4.c | 4 +- libgfortran/generated/maxval_r8.c | 4 +- libgfortran/generated/minloc1_16_i1.c | 4 +- libgfortran/generated/minloc1_16_i16.c | 4 +- libgfortran/generated/minloc1_16_i2.c | 4 +- libgfortran/generated/minloc1_16_i4.c | 4 +- libgfortran/generated/minloc1_16_i8.c | 4 +- libgfortran/generated/minloc1_16_r10.c | 4 +- libgfortran/generated/minloc1_16_r16.c | 4 +- libgfortran/generated/minloc1_16_r17.c | 4 +- libgfortran/generated/minloc1_16_r4.c | 4 +- libgfortran/generated/minloc1_16_r8.c | 4 +- libgfortran/generated/minloc1_16_s1.c | 4 +- libgfortran/generated/minloc1_16_s4.c | 4 +- libgfortran/generated/minloc1_4_i1.c | 4 +- libgfortran/generated/minloc1_4_i16.c | 4 +- libgfortran/generated/minloc1_4_i2.c | 4 +- libgfortran/generated/minloc1_4_i4.c | 4 +- libgfortran/generated/minloc1_4_i8.c | 4 +- libgfortran/generated/minloc1_4_r10.c | 4 +- libgfortran/generated/minloc1_4_r16.c | 4 +- libgfortran/generated/minloc1_4_r17.c | 4 +- libgfortran/generated/minloc1_4_r4.c | 4 +- libgfortran/generated/minloc1_4_r8.c | 4 +- libgfortran/generated/minloc1_4_s1.c | 4 +- libgfortran/generated/minloc1_4_s4.c | 4 +- libgfortran/generated/minloc1_8_i1.c | 4 +- libgfortran/generated/minloc1_8_i16.c | 4 +- libgfortran/generated/minloc1_8_i2.c | 4 +- libgfortran/generated/minloc1_8_i4.c | 4 +- libgfortran/generated/minloc1_8_i8.c | 4 +- libgfortran/generated/minloc1_8_r10.c | 4 +- libgfortran/generated/minloc1_8_r16.c | 4 +- libgfortran/generated/minloc1_8_r17.c | 4 +- libgfortran/generated/minloc1_8_r4.c | 4 +- libgfortran/generated/minloc1_8_r8.c | 4 +- libgfortran/generated/minloc1_8_s1.c | 4 +- libgfortran/generated/minloc1_8_s4.c | 4 +- libgfortran/generated/minval1_s1.c | 4 +- libgfortran/generated/minval1_s4.c | 4 +- libgfortran/generated/minval_i1.c | 4 +- libgfortran/generated/minval_i16.c | 4 +- libgfortran/generated/minval_i2.c | 4 +- libgfortran/generated/minval_i4.c | 4 +- libgfortran/generated/minval_i8.c | 4 +- libgfortran/generated/minval_r10.c | 4 +- libgfortran/generated/minval_r16.c | 4 +- libgfortran/generated/minval_r17.c | 4 +- libgfortran/generated/minval_r4.c | 4 +- libgfortran/generated/minval_r8.c | 4 +- libgfortran/generated/product_c10.c | 4 +- libgfortran/generated/product_c16.c | 4 +- libgfortran/generated/product_c17.c | 4 +- libgfortran/generated/product_c4.c | 4 +- libgfortran/generated/product_c8.c | 4 +- libgfortran/generated/product_i1.c | 4 +- libgfortran/generated/product_i16.c | 4 +- libgfortran/generated/product_i2.c | 4 +- libgfortran/generated/product_i4.c | 4 +- libgfortran/generated/product_i8.c | 4 +- libgfortran/generated/product_r10.c | 4 +- libgfortran/generated/product_r16.c | 4 +- libgfortran/generated/product_r17.c | 4 +- libgfortran/generated/product_r4.c | 4 +- libgfortran/generated/product_r8.c | 4 +- libgfortran/generated/sum_c10.c | 4 +- libgfortran/generated/sum_c16.c | 4 +- libgfortran/generated/sum_c17.c | 4 +- libgfortran/generated/sum_c4.c | 4 +- libgfortran/generated/sum_c8.c | 4 +- libgfortran/generated/sum_i1.c | 4 +- libgfortran/generated/sum_i16.c | 4 +- libgfortran/generated/sum_i2.c | 4 +- libgfortran/generated/sum_i4.c | 4 +- libgfortran/generated/sum_i8.c | 4 +- libgfortran/generated/sum_r10.c | 4 +- libgfortran/generated/sum_r16.c | 4 +- libgfortran/generated/sum_r17.c | 4 +- libgfortran/generated/sum_r4.c | 4 +- libgfortran/generated/sum_r8.c | 4 +- libgfortran/m4/ifunction-s.m4 | 4 +- libgfortran/m4/ifunction-s2.m4 | 4 +- libgfortran/m4/ifunction.m4 | 4 +- 145 files changed, 495 insertions(+), 288 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/bound_10.f90 diff --git a/gcc/testsuite/gfortran.dg/bound_10.f90 b/gcc/testsuite/gfortran.dg/bound_10.f90 new file mode 100644 index 00000000000..cbe065cf2b6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bound_10.f90 @@ -0,0 +1,207 @@ +! { dg-do run } +! +! PR fortran/112371 +! The library used to not set the bounds and content of the resulting array +! of a reduction function if the input array had zero extent along the +! reduction dimension. + +program p + implicit none + call check_iall + call check_iany + call check_iparity + call check_minloc_int + call check_minloc_char + call check_maxloc_real + call check_maxloc_char + call check_minval_int + call check_minval_char + call check_maxval_real + call check_maxval_char + call check_sum + call check_product +contains + subroutine check_iall + integer :: a(3,0,2) + logical(kind=1) :: m(3,0,2) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ integer:: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 2 + r = iall(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 11 + if (any(ubound(r) /= (/ 3, 2 /))) stop 12 + if (any(shape(r) /= (/ 3, 2 /))) stop 13 + if (any(r /= int(z'FFFFFFFF'))) stop 14 + end subroutine + subroutine check_iany + integer(kind=8) :: a(2,3,0) + logical(kind=1) :: m(2,3,0) + integer :: i + integer(kind=8), allocatable :: r(:,:) + a = reshape((/ integer(kind=8):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 3 + r = iany(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 21 + if (any(ubound(r) /= (/ 2, 3 /))) stop 22 + if (any(shape(r) /= (/ 2, 3 /))) stop 23 + if (any(r /= 0)) stop 24 + end subroutine + subroutine check_iparity + integer(kind=2) :: a(0,2,3) + logical(kind=1) :: m(0,2,3) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ integer(kind=2):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 1 + r = iparity(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 31 + if (any(ubound(r) /= (/ 2, 3 /))) stop 32 + if (any(shape(r) /= (/ 2, 3 /))) stop 33 + if (any(r /= 0)) stop 34 + end subroutine + subroutine check_minloc_int + integer :: a(3,0,2) + logical(kind=1) :: m(3,0,2) + integer :: i, j + integer, allocatable :: r(:,:) + a = reshape((/ integer:: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 2 + r = minloc(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 41 + if (any(ubound(r) /= (/ 3, 2 /))) stop 42 + if (any(shape(r) /= (/ 3, 2 /))) stop 43 + if (any(r /= 0)) stop 44 + end subroutine + subroutine check_minloc_char + character :: a(2,3,0) + logical(kind=1) :: m(2,3,0) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ character:: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 3 + r = minloc(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 51 + if (any(ubound(r) /= (/ 2, 3 /))) stop 52 + if (any(shape(r) /= (/ 2, 3 /))) stop 53 + if (any(r /= 0)) stop 54 + end subroutine + subroutine check_maxloc_real + real :: a(0,2,3) + logical(kind=1) :: m(0,2,3) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ real:: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 1 + r = maxloc(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 61 + if (any(ubound(r) /= (/ 2, 3 /))) stop 62 + if (any(shape(r) /= (/ 2, 3 /))) stop 63 + if (any(r /= 0)) stop 64 + end subroutine + subroutine check_maxloc_char + character(len=2) :: a(3,0,2) + logical(kind=1) :: m(3,0,2) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ character(len=2):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 2 + r = maxloc(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 71 + if (any(ubound(r) /= (/ 3, 2 /))) stop 72 + if (any(shape(r) /= (/ 3, 2 /))) stop 73 + if (any(r /= 0)) stop 74 + end subroutine + subroutine check_minval_int + integer(kind=2) :: a(3,2,0) + logical(kind=1) :: m(3,2,0) + integer :: i, j + integer, allocatable :: r(:,:) + a = reshape((/ integer(kind=2):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 3 + r = minval(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 81 + if (any(ubound(r) /= (/ 3, 2 /))) stop 82 + if (any(shape(r) /= (/ 3, 2 /))) stop 83 + if (any(r /= huge(1_2))) stop 84 + end subroutine + subroutine check_minval_char + character(kind=4) :: a(0,3,2) + logical(kind=1) :: m(0,3,2) + integer :: i + character(kind=4), allocatable :: r(:,:) + a = reshape((/ character(kind=4):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 1 + r = minval(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 91 + if (any(ubound(r) /= (/ 3, 2 /))) stop 92 + if (any(shape(r) /= (/ 3, 2 /))) stop 93 + if (any(r /= char(int(z'FFFFFFFF', kind=8), kind=4))) stop 94 + end subroutine + subroutine check_maxval_real + real(kind=8) :: a(0,2,3) + logical(kind=1) :: m(0,2,3) + integer :: i + real(kind=8), allocatable :: r(:,:) + a = reshape((/ real(kind=8):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 1 + r = maxval(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 101 + if (any(ubound(r) /= (/ 2, 3 /))) stop 102 + if (any(shape(r) /= (/ 2, 3 /))) stop 103 + if (any(r /= -huge(1._8))) stop 104 + end subroutine + subroutine check_maxval_char + character(kind=4,len=2) :: a(3,0,2), e + logical(kind=1) :: m(3,0,2) + integer :: i + character(len=2,kind=4), allocatable :: r(:,:) + a = reshape((/ character(kind=4,len=2):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 2 + r = maxval(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 111 + if (any(ubound(r) /= (/ 3, 2 /))) stop 112 + if (any(shape(r) /= (/ 3, 2 /))) stop 113 + e = repeat(char(0, kind=4), len(a)) + if (any(r /= e)) stop 114 + end subroutine + subroutine check_sum + integer(kind=1) :: a(2,3,0) + logical(kind=1) :: m(2,3,0) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ integer:: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 3 + r = sum(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 121 + if (any(ubound(r) /= (/ 2, 3 /))) stop 122 + if (any(shape(r) /= (/ 2, 3 /))) stop 123 + if (any(r /= 0)) stop 124 + end subroutine + subroutine check_product + real(kind=8) :: a(0,2,3) + logical(kind=1) :: m(0,2,3) + integer :: i + integer, allocatable :: r(:,:) + a = reshape((/ real(kind=8):: /), shape(a)) + m = reshape((/ logical(kind=1):: /), shape(m)) + i = 1 + r = product(a, dim=i, mask=m) + if (any(lbound(r) /= 1)) stop 131 + if (any(ubound(r) /= (/ 2, 3 /))) stop 132 + if (any(shape(r) /= (/ 2, 3 /))) stop 133 + if (any(r /= 1.0_8)) stop 134 + end subroutine +end program diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c index c9696c92485..2236f044e65 100644 --- a/libgfortran/generated/iall_i1.c +++ b/libgfortran/generated/iall_i1.c @@ -242,8 +242,8 @@ miall_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c index f0a1b3adcf2..96ca5a57c9c 100644 --- a/libgfortran/generated/iall_i16.c +++ b/libgfortran/generated/iall_i16.c @@ -242,8 +242,8 @@ miall_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c index 4d14d71cab2..4d895db2b35 100644 --- a/libgfortran/generated/iall_i2.c +++ b/libgfortran/generated/iall_i2.c @@ -242,8 +242,8 @@ miall_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c index cb7ce755bfc..673e9809483 100644 --- a/libgfortran/generated/iall_i4.c +++ b/libgfortran/generated/iall_i4.c @@ -242,8 +242,8 @@ miall_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c index c7dab3e2e56..4de6ff1782d 100644 --- a/libgfortran/generated/iall_i8.c +++ b/libgfortran/generated/iall_i8.c @@ -242,8 +242,8 @@ miall_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c index 539c5389561..ab191d6bdd2 100644 --- a/libgfortran/generated/iany_i1.c +++ b/libgfortran/generated/iany_i1.c @@ -242,8 +242,8 @@ miany_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c index d690dff60be..8fda0efea82 100644 --- a/libgfortran/generated/iany_i16.c +++ b/libgfortran/generated/iany_i16.c @@ -242,8 +242,8 @@ miany_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c index dd37c1e5b48..43080b85992 100644 --- a/libgfortran/generated/iany_i2.c +++ b/libgfortran/generated/iany_i2.c @@ -242,8 +242,8 @@ miany_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c index e9689904951..d8430ca4e90 100644 --- a/libgfortran/generated/iany_i4.c +++ b/libgfortran/generated/iany_i4.c @@ -242,8 +242,8 @@ miany_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c index 79f6c381a3f..7d3ac16412d 100644 --- a/libgfortran/generated/iany_i8.c +++ b/libgfortran/generated/iany_i8.c @@ -242,8 +242,8 @@ miany_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c index 8e0f4529d4d..53b15cbb73f 100644 --- a/libgfortran/generated/iparity_i1.c +++ b/libgfortran/generated/iparity_i1.c @@ -242,8 +242,8 @@ miparity_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c index 912ca591dda..848ac6284fb 100644 --- a/libgfortran/generated/iparity_i16.c +++ b/libgfortran/generated/iparity_i16.c @@ -242,8 +242,8 @@ miparity_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c index 6e7e60a5a2e..f435fd27edd 100644 --- a/libgfortran/generated/iparity_i2.c +++ b/libgfortran/generated/iparity_i2.c @@ -242,8 +242,8 @@ miparity_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c index 0bb1be1dedb..ea876bdd31a 100644 --- a/libgfortran/generated/iparity_i4.c +++ b/libgfortran/generated/iparity_i4.c @@ -242,8 +242,8 @@ miparity_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c index e219d6e3dce..0fee2e5025d 100644 --- a/libgfortran/generated/iparity_i8.c +++ b/libgfortran/generated/iparity_i8.c @@ -242,8 +242,8 @@ miparity_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c index e126c18bc80..bc0643cde1e 100644 --- a/libgfortran/generated/maxloc1_16_i1.c +++ b/libgfortran/generated/maxloc1_16_i1.c @@ -270,8 +270,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c index 04ced535df9..5dca85c4bc0 100644 --- a/libgfortran/generated/maxloc1_16_i16.c +++ b/libgfortran/generated/maxloc1_16_i16.c @@ -270,8 +270,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c index 9f7447e9de9..118d7c527a1 100644 --- a/libgfortran/generated/maxloc1_16_i2.c +++ b/libgfortran/generated/maxloc1_16_i2.c @@ -270,8 +270,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c index 8663dfc7e24..858dfc0e850 100644 --- a/libgfortran/generated/maxloc1_16_i4.c +++ b/libgfortran/generated/maxloc1_16_i4.c @@ -270,8 +270,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c index c0593a67f11..36469e49797 100644 --- a/libgfortran/generated/maxloc1_16_i8.c +++ b/libgfortran/generated/maxloc1_16_i8.c @@ -270,8 +270,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c index a5e0665fccf..dfc55681b1f 100644 --- a/libgfortran/generated/maxloc1_16_r10.c +++ b/libgfortran/generated/maxloc1_16_r10.c @@ -270,8 +270,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c index cbb20002665..17daa796afc 100644 --- a/libgfortran/generated/maxloc1_16_r16.c +++ b/libgfortran/generated/maxloc1_16_r16.c @@ -270,8 +270,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_r17.c b/libgfortran/generated/maxloc1_16_r17.c index 719ae09772d..46fd4ab320c 100644 --- a/libgfortran/generated/maxloc1_16_r17.c +++ b/libgfortran/generated/maxloc1_16_r17.c @@ -270,8 +270,8 @@ mmaxloc1_16_r17 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c index 37a0657dab2..b52932f70bf 100644 --- a/libgfortran/generated/maxloc1_16_r4.c +++ b/libgfortran/generated/maxloc1_16_r4.c @@ -270,8 +270,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c index 305613694b2..c26c4b4ed0a 100644 --- a/libgfortran/generated/maxloc1_16_r8.c +++ b/libgfortran/generated/maxloc1_16_r8.c @@ -270,8 +270,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c index b9a8a639596..54f57238367 100644 --- a/libgfortran/generated/maxloc1_16_s1.c +++ b/libgfortran/generated/maxloc1_16_s1.c @@ -263,8 +263,8 @@ mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c index fdaad7fd2dc..eb015eabef2 100644 --- a/libgfortran/generated/maxloc1_16_s4.c +++ b/libgfortran/generated/maxloc1_16_s4.c @@ -263,8 +263,8 @@ mmaxloc1_16_s4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c index b68d92ef44e..4b0bd56a60b 100644 --- a/libgfortran/generated/maxloc1_4_i1.c +++ b/libgfortran/generated/maxloc1_4_i1.c @@ -270,8 +270,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c index 9221e22505b..d976d2d4b8e 100644 --- a/libgfortran/generated/maxloc1_4_i16.c +++ b/libgfortran/generated/maxloc1_4_i16.c @@ -270,8 +270,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c index 3fa2e367898..ba8228925d4 100644 --- a/libgfortran/generated/maxloc1_4_i2.c +++ b/libgfortran/generated/maxloc1_4_i2.c @@ -270,8 +270,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c index 5ef2abb98e1..644e48e547f 100644 --- a/libgfortran/generated/maxloc1_4_i4.c +++ b/libgfortran/generated/maxloc1_4_i4.c @@ -270,8 +270,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c index 102d394b309..fd5d31b5162 100644 --- a/libgfortran/generated/maxloc1_4_i8.c +++ b/libgfortran/generated/maxloc1_4_i8.c @@ -270,8 +270,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c index 623204d792c..00c90fa3c66 100644 --- a/libgfortran/generated/maxloc1_4_r10.c +++ b/libgfortran/generated/maxloc1_4_r10.c @@ -270,8 +270,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c index 92209ce79ce..92372b8d837 100644 --- a/libgfortran/generated/maxloc1_4_r16.c +++ b/libgfortran/generated/maxloc1_4_r16.c @@ -270,8 +270,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_r17.c b/libgfortran/generated/maxloc1_4_r17.c index 6ee34b52719..10c68752188 100644 --- a/libgfortran/generated/maxloc1_4_r17.c +++ b/libgfortran/generated/maxloc1_4_r17.c @@ -270,8 +270,8 @@ mmaxloc1_4_r17 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index ea6123a987c..b0750c19361 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -270,8 +270,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c index ba83b4d6a6d..3be87685eed 100644 --- a/libgfortran/generated/maxloc1_4_r8.c +++ b/libgfortran/generated/maxloc1_4_r8.c @@ -270,8 +270,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c index 7d2ab07915e..91628645d1c 100644 --- a/libgfortran/generated/maxloc1_4_s1.c +++ b/libgfortran/generated/maxloc1_4_s1.c @@ -263,8 +263,8 @@ mmaxloc1_4_s1 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c index 7a4950d3e5c..7cb056ea10b 100644 --- a/libgfortran/generated/maxloc1_4_s4.c +++ b/libgfortran/generated/maxloc1_4_s4.c @@ -263,8 +263,8 @@ mmaxloc1_4_s4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c index d243e6e027c..42b113b1d0c 100644 --- a/libgfortran/generated/maxloc1_8_i1.c +++ b/libgfortran/generated/maxloc1_8_i1.c @@ -270,8 +270,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c index 5871aa52379..594c735ad77 100644 --- a/libgfortran/generated/maxloc1_8_i16.c +++ b/libgfortran/generated/maxloc1_8_i16.c @@ -270,8 +270,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c index 9337f47c9ca..9e141af3ecd 100644 --- a/libgfortran/generated/maxloc1_8_i2.c +++ b/libgfortran/generated/maxloc1_8_i2.c @@ -270,8 +270,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c index 747b9979fdc..b94c627dfd6 100644 --- a/libgfortran/generated/maxloc1_8_i4.c +++ b/libgfortran/generated/maxloc1_8_i4.c @@ -270,8 +270,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c index adc0ebae28d..18e45033b40 100644 --- a/libgfortran/generated/maxloc1_8_i8.c +++ b/libgfortran/generated/maxloc1_8_i8.c @@ -270,8 +270,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c index 4c8d00d937d..22cd8c26e1b 100644 --- a/libgfortran/generated/maxloc1_8_r10.c +++ b/libgfortran/generated/maxloc1_8_r10.c @@ -270,8 +270,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c index df3edbe611b..646fe18a975 100644 --- a/libgfortran/generated/maxloc1_8_r16.c +++ b/libgfortran/generated/maxloc1_8_r16.c @@ -270,8 +270,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_r17.c b/libgfortran/generated/maxloc1_8_r17.c index 162806132f1..cc6bb86546c 100644 --- a/libgfortran/generated/maxloc1_8_r17.c +++ b/libgfortran/generated/maxloc1_8_r17.c @@ -270,8 +270,8 @@ mmaxloc1_8_r17 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c index dee860a1a8f..2c482bc8ed4 100644 --- a/libgfortran/generated/maxloc1_8_r4.c +++ b/libgfortran/generated/maxloc1_8_r4.c @@ -270,8 +270,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c index 215d9668adb..32452d49ff3 100644 --- a/libgfortran/generated/maxloc1_8_r8.c +++ b/libgfortran/generated/maxloc1_8_r8.c @@ -270,8 +270,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c index 7b1091d596c..96ac1ac0bd4 100644 --- a/libgfortran/generated/maxloc1_8_s1.c +++ b/libgfortran/generated/maxloc1_8_s1.c @@ -263,8 +263,8 @@ mmaxloc1_8_s1 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c index a61c08c6f64..068c4ff7a72 100644 --- a/libgfortran/generated/maxloc1_8_s4.c +++ b/libgfortran/generated/maxloc1_8_s4.c @@ -263,8 +263,8 @@ mmaxloc1_8_s4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval1_s1.c b/libgfortran/generated/maxval1_s1.c index fd65f4b62ec..6ad5366b8f3 100644 --- a/libgfortran/generated/maxval1_s1.c +++ b/libgfortran/generated/maxval1_s1.c @@ -258,8 +258,8 @@ mmaxval1_s1 (gfc_array_s1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval1_s4.c b/libgfortran/generated/maxval1_s4.c index 3558e61c76a..6337b043a3e 100644 --- a/libgfortran/generated/maxval1_s4.c +++ b/libgfortran/generated/maxval1_s4.c @@ -258,8 +258,8 @@ mmaxval1_s4 (gfc_array_s4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c index bc52cd74a95..19feced6861 100644 --- a/libgfortran/generated/maxval_i1.c +++ b/libgfortran/generated/maxval_i1.c @@ -256,8 +256,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c index 1d9d33369d4..cd75603b066 100644 --- a/libgfortran/generated/maxval_i16.c +++ b/libgfortran/generated/maxval_i16.c @@ -256,8 +256,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c index fe3c6fecce7..9c7eb7702e3 100644 --- a/libgfortran/generated/maxval_i2.c +++ b/libgfortran/generated/maxval_i2.c @@ -256,8 +256,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c index 0412c7a7583..40bf1ce97ab 100644 --- a/libgfortran/generated/maxval_i4.c +++ b/libgfortran/generated/maxval_i4.c @@ -256,8 +256,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c index 2037b96b3c5..0b6b9f671ee 100644 --- a/libgfortran/generated/maxval_i8.c +++ b/libgfortran/generated/maxval_i8.c @@ -256,8 +256,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c index 7c397eeea77..f83c4e9965a 100644 --- a/libgfortran/generated/maxval_r10.c +++ b/libgfortran/generated/maxval_r10.c @@ -256,8 +256,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c index 1f2144e5253..ec2d7a92be5 100644 --- a/libgfortran/generated/maxval_r16.c +++ b/libgfortran/generated/maxval_r16.c @@ -256,8 +256,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_r17.c b/libgfortran/generated/maxval_r17.c index f85460366aa..442e2b3a387 100644 --- a/libgfortran/generated/maxval_r17.c +++ b/libgfortran/generated/maxval_r17.c @@ -256,8 +256,8 @@ mmaxval_r17 (gfc_array_r17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c index e2fd59e92bc..6c08b342752 100644 --- a/libgfortran/generated/maxval_r4.c +++ b/libgfortran/generated/maxval_r4.c @@ -256,8 +256,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c index d3aadc62529..30d259f7708 100644 --- a/libgfortran/generated/maxval_r8.c +++ b/libgfortran/generated/maxval_r8.c @@ -256,8 +256,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c index 541d71fe214..80abb3cf8e0 100644 --- a/libgfortran/generated/minloc1_16_i1.c +++ b/libgfortran/generated/minloc1_16_i1.c @@ -280,8 +280,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c index baaf02597b6..388a8f91208 100644 --- a/libgfortran/generated/minloc1_16_i16.c +++ b/libgfortran/generated/minloc1_16_i16.c @@ -280,8 +280,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c index e4f78b65de3..51ae92b91fb 100644 --- a/libgfortran/generated/minloc1_16_i2.c +++ b/libgfortran/generated/minloc1_16_i2.c @@ -280,8 +280,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c index c561d71319e..675fc333d52 100644 --- a/libgfortran/generated/minloc1_16_i4.c +++ b/libgfortran/generated/minloc1_16_i4.c @@ -280,8 +280,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c index ebdb68dd3c5..6a417880a12 100644 --- a/libgfortran/generated/minloc1_16_i8.c +++ b/libgfortran/generated/minloc1_16_i8.c @@ -280,8 +280,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c index 98d3fb3879b..f5d9c347ef9 100644 --- a/libgfortran/generated/minloc1_16_r10.c +++ b/libgfortran/generated/minloc1_16_r10.c @@ -280,8 +280,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c index ad445a42dfa..3405c0e4bef 100644 --- a/libgfortran/generated/minloc1_16_r16.c +++ b/libgfortran/generated/minloc1_16_r16.c @@ -280,8 +280,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_r17.c b/libgfortran/generated/minloc1_16_r17.c index 339d9ad9662..e3d0d417e5d 100644 --- a/libgfortran/generated/minloc1_16_r17.c +++ b/libgfortran/generated/minloc1_16_r17.c @@ -280,8 +280,8 @@ mminloc1_16_r17 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c index 780bcc267fd..8af09702f5c 100644 --- a/libgfortran/generated/minloc1_16_r4.c +++ b/libgfortran/generated/minloc1_16_r4.c @@ -280,8 +280,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c index 124587f5fb3..9397dc6ff91 100644 --- a/libgfortran/generated/minloc1_16_r8.c +++ b/libgfortran/generated/minloc1_16_r8.c @@ -280,8 +280,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c index f4763dc6e64..c6d8861a5f4 100644 --- a/libgfortran/generated/minloc1_16_s1.c +++ b/libgfortran/generated/minloc1_16_s1.c @@ -263,8 +263,8 @@ mminloc1_16_s1 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c index ba0475a9ca0..0f5eb2db869 100644 --- a/libgfortran/generated/minloc1_16_s4.c +++ b/libgfortran/generated/minloc1_16_s4.c @@ -263,8 +263,8 @@ mminloc1_16_s4 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c index 433a25a8ef8..4274e70dc92 100644 --- a/libgfortran/generated/minloc1_4_i1.c +++ b/libgfortran/generated/minloc1_4_i1.c @@ -280,8 +280,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c index 9d2c606186b..ded68f0b0fb 100644 --- a/libgfortran/generated/minloc1_4_i16.c +++ b/libgfortran/generated/minloc1_4_i16.c @@ -280,8 +280,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c index 73737011e9a..a053dd352e5 100644 --- a/libgfortran/generated/minloc1_4_i2.c +++ b/libgfortran/generated/minloc1_4_i2.c @@ -280,8 +280,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c index d18416ebcc4..6292fc2d9b7 100644 --- a/libgfortran/generated/minloc1_4_i4.c +++ b/libgfortran/generated/minloc1_4_i4.c @@ -280,8 +280,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c index 4f7dfdfdf73..9240e3fe5bd 100644 --- a/libgfortran/generated/minloc1_4_i8.c +++ b/libgfortran/generated/minloc1_4_i8.c @@ -280,8 +280,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c index ff5af01130d..42a9de0b6d0 100644 --- a/libgfortran/generated/minloc1_4_r10.c +++ b/libgfortran/generated/minloc1_4_r10.c @@ -280,8 +280,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c index 2d664467df3..06193f13598 100644 --- a/libgfortran/generated/minloc1_4_r16.c +++ b/libgfortran/generated/minloc1_4_r16.c @@ -280,8 +280,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_r17.c b/libgfortran/generated/minloc1_4_r17.c index 711fd841d34..d021d46b9fa 100644 --- a/libgfortran/generated/minloc1_4_r17.c +++ b/libgfortran/generated/minloc1_4_r17.c @@ -280,8 +280,8 @@ mminloc1_4_r17 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c index 0739d9bd178..e6990c6e70e 100644 --- a/libgfortran/generated/minloc1_4_r4.c +++ b/libgfortran/generated/minloc1_4_r4.c @@ -280,8 +280,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c index d625195e432..fd1574f6413 100644 --- a/libgfortran/generated/minloc1_4_r8.c +++ b/libgfortran/generated/minloc1_4_r8.c @@ -280,8 +280,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c index 13ebc76524d..5bbc844e196 100644 --- a/libgfortran/generated/minloc1_4_s1.c +++ b/libgfortran/generated/minloc1_4_s1.c @@ -263,8 +263,8 @@ mminloc1_4_s1 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c index 5c9a5900237..4f2ab20ab9f 100644 --- a/libgfortran/generated/minloc1_4_s4.c +++ b/libgfortran/generated/minloc1_4_s4.c @@ -263,8 +263,8 @@ mminloc1_4_s4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c index fab5619979f..1b8b24064d9 100644 --- a/libgfortran/generated/minloc1_8_i1.c +++ b/libgfortran/generated/minloc1_8_i1.c @@ -280,8 +280,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c index 742e2ea73b2..9561270e150 100644 --- a/libgfortran/generated/minloc1_8_i16.c +++ b/libgfortran/generated/minloc1_8_i16.c @@ -280,8 +280,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c index defef3c653c..979856579f9 100644 --- a/libgfortran/generated/minloc1_8_i2.c +++ b/libgfortran/generated/minloc1_8_i2.c @@ -280,8 +280,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c index 3e696aafcac..1c303ed6dea 100644 --- a/libgfortran/generated/minloc1_8_i4.c +++ b/libgfortran/generated/minloc1_8_i4.c @@ -280,8 +280,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c index 9a017433ee6..6249f20ae62 100644 --- a/libgfortran/generated/minloc1_8_i8.c +++ b/libgfortran/generated/minloc1_8_i8.c @@ -280,8 +280,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c index 18f294f2180..2c6a0fd8a58 100644 --- a/libgfortran/generated/minloc1_8_r10.c +++ b/libgfortran/generated/minloc1_8_r10.c @@ -280,8 +280,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c index 1dd45dead26..f7d06648c37 100644 --- a/libgfortran/generated/minloc1_8_r16.c +++ b/libgfortran/generated/minloc1_8_r16.c @@ -280,8 +280,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_r17.c b/libgfortran/generated/minloc1_8_r17.c index 85dc6cb04fe..0cc70c439d0 100644 --- a/libgfortran/generated/minloc1_8_r17.c +++ b/libgfortran/generated/minloc1_8_r17.c @@ -280,8 +280,8 @@ mminloc1_8_r17 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c index 6d7764a5eb7..b2ae3dfcc06 100644 --- a/libgfortran/generated/minloc1_8_r4.c +++ b/libgfortran/generated/minloc1_8_r4.c @@ -280,8 +280,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c index e17d3c881c0..bafd72d0893 100644 --- a/libgfortran/generated/minloc1_8_r8.c +++ b/libgfortran/generated/minloc1_8_r8.c @@ -280,8 +280,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c index 0449575a5a3..8a40b52a188 100644 --- a/libgfortran/generated/minloc1_8_s1.c +++ b/libgfortran/generated/minloc1_8_s1.c @@ -263,8 +263,8 @@ mminloc1_8_s1 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c index 682b89b2765..906d1df9a2e 100644 --- a/libgfortran/generated/minloc1_8_s4.c +++ b/libgfortran/generated/minloc1_8_s4.c @@ -263,8 +263,8 @@ mminloc1_8_s4 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval1_s1.c b/libgfortran/generated/minval1_s1.c index 9c577ed004c..d83fef19d3c 100644 --- a/libgfortran/generated/minval1_s1.c +++ b/libgfortran/generated/minval1_s1.c @@ -258,8 +258,8 @@ mminval1_s1 (gfc_array_s1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval1_s4.c b/libgfortran/generated/minval1_s4.c index 9a30bf0bfb5..5ef09cdeebb 100644 --- a/libgfortran/generated/minval1_s4.c +++ b/libgfortran/generated/minval1_s4.c @@ -258,8 +258,8 @@ mminval1_s4 (gfc_array_s4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c index 174161af4d4..544a996a01c 100644 --- a/libgfortran/generated/minval_i1.c +++ b/libgfortran/generated/minval_i1.c @@ -256,8 +256,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c index b220391e4f8..1bcdf58792a 100644 --- a/libgfortran/generated/minval_i16.c +++ b/libgfortran/generated/minval_i16.c @@ -256,8 +256,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c index 3a050c1eb82..61801f163f2 100644 --- a/libgfortran/generated/minval_i2.c +++ b/libgfortran/generated/minval_i2.c @@ -256,8 +256,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c index 194967d2f92..019a880e2ab 100644 --- a/libgfortran/generated/minval_i4.c +++ b/libgfortran/generated/minval_i4.c @@ -256,8 +256,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c index 07acc60d4a0..abbbd06da07 100644 --- a/libgfortran/generated/minval_i8.c +++ b/libgfortran/generated/minval_i8.c @@ -256,8 +256,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c index d49244c1dff..d5b9d76d9e6 100644 --- a/libgfortran/generated/minval_r10.c +++ b/libgfortran/generated/minval_r10.c @@ -256,8 +256,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c index 50305430d60..9fdde79f4fc 100644 --- a/libgfortran/generated/minval_r16.c +++ b/libgfortran/generated/minval_r16.c @@ -256,8 +256,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_r17.c b/libgfortran/generated/minval_r17.c index 2479a864af3..3e75af04b2d 100644 --- a/libgfortran/generated/minval_r17.c +++ b/libgfortran/generated/minval_r17.c @@ -256,8 +256,8 @@ mminval_r17 (gfc_array_r17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c index ceca490cfcd..f096473e5ad 100644 --- a/libgfortran/generated/minval_r4.c +++ b/libgfortran/generated/minval_r4.c @@ -256,8 +256,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c index 091cb74d30d..8fafc3c1869 100644 --- a/libgfortran/generated/minval_r8.c +++ b/libgfortran/generated/minval_r8.c @@ -256,8 +256,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c index b888769130d..7ecd80e3346 100644 --- a/libgfortran/generated/product_c10.c +++ b/libgfortran/generated/product_c10.c @@ -242,8 +242,8 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c index b783367ff05..e1d0c932a08 100644 --- a/libgfortran/generated/product_c16.c +++ b/libgfortran/generated/product_c16.c @@ -242,8 +242,8 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_c17.c b/libgfortran/generated/product_c17.c index e89e9eea0c3..2ed08b31f1e 100644 --- a/libgfortran/generated/product_c17.c +++ b/libgfortran/generated/product_c17.c @@ -242,8 +242,8 @@ mproduct_c17 (gfc_array_c17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c index 08b2878930b..dbf00aacf7a 100644 --- a/libgfortran/generated/product_c4.c +++ b/libgfortran/generated/product_c4.c @@ -242,8 +242,8 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c index cb721e50b65..1a3f27d329e 100644 --- a/libgfortran/generated/product_c8.c +++ b/libgfortran/generated/product_c8.c @@ -242,8 +242,8 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c index 8af7d63c654..35f4f6ec804 100644 --- a/libgfortran/generated/product_i1.c +++ b/libgfortran/generated/product_i1.c @@ -242,8 +242,8 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c index de9b7fb503a..3b815036f4f 100644 --- a/libgfortran/generated/product_i16.c +++ b/libgfortran/generated/product_i16.c @@ -242,8 +242,8 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c index bb0283286c1..e998c0d59c3 100644 --- a/libgfortran/generated/product_i2.c +++ b/libgfortran/generated/product_i2.c @@ -242,8 +242,8 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index 9491031c3a8..7dbc77aff9f 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -242,8 +242,8 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c index 49d09318335..aaa688b69ff 100644 --- a/libgfortran/generated/product_i8.c +++ b/libgfortran/generated/product_i8.c @@ -242,8 +242,8 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c index 47af031fe90..8a7dba54fdd 100644 --- a/libgfortran/generated/product_r10.c +++ b/libgfortran/generated/product_r10.c @@ -242,8 +242,8 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c index 3ecafc170e3..38c9922ed9b 100644 --- a/libgfortran/generated/product_r16.c +++ b/libgfortran/generated/product_r16.c @@ -242,8 +242,8 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_r17.c b/libgfortran/generated/product_r17.c index 8f79c8c9c65..37ed80c9d3a 100644 --- a/libgfortran/generated/product_r17.c +++ b/libgfortran/generated/product_r17.c @@ -242,8 +242,8 @@ mproduct_r17 (gfc_array_r17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c index f9b09b3c6dc..616fd5be89d 100644 --- a/libgfortran/generated/product_r4.c +++ b/libgfortran/generated/product_r4.c @@ -242,8 +242,8 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c index ff6aa522176..c4b710dfc6f 100644 --- a/libgfortran/generated/product_r8.c +++ b/libgfortran/generated/product_r8.c @@ -242,8 +242,8 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c index 45018f88c6f..6de84a7e2ea 100644 --- a/libgfortran/generated/sum_c10.c +++ b/libgfortran/generated/sum_c10.c @@ -242,8 +242,8 @@ msum_c10 (gfc_array_c10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c index df4297c5a84..96fc8882902 100644 --- a/libgfortran/generated/sum_c16.c +++ b/libgfortran/generated/sum_c16.c @@ -242,8 +242,8 @@ msum_c16 (gfc_array_c16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_c17.c b/libgfortran/generated/sum_c17.c index 65322e78989..1472fe57733 100644 --- a/libgfortran/generated/sum_c17.c +++ b/libgfortran/generated/sum_c17.c @@ -242,8 +242,8 @@ msum_c17 (gfc_array_c17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c index 11ce95d53c3..250aa416cb3 100644 --- a/libgfortran/generated/sum_c4.c +++ b/libgfortran/generated/sum_c4.c @@ -242,8 +242,8 @@ msum_c4 (gfc_array_c4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c index 16b9ed40e92..510a25847ac 100644 --- a/libgfortran/generated/sum_c8.c +++ b/libgfortran/generated/sum_c8.c @@ -242,8 +242,8 @@ msum_c8 (gfc_array_c8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c index c2df9619f98..974522b3bbf 100644 --- a/libgfortran/generated/sum_i1.c +++ b/libgfortran/generated/sum_i1.c @@ -242,8 +242,8 @@ msum_i1 (gfc_array_i1 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c index d4b3d970e51..00f644bff71 100644 --- a/libgfortran/generated/sum_i16.c +++ b/libgfortran/generated/sum_i16.c @@ -242,8 +242,8 @@ msum_i16 (gfc_array_i16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c index 044361c6167..448273594f4 100644 --- a/libgfortran/generated/sum_i2.c +++ b/libgfortran/generated/sum_i2.c @@ -242,8 +242,8 @@ msum_i2 (gfc_array_i2 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c index b37393e4c70..529fb2e94a0 100644 --- a/libgfortran/generated/sum_i4.c +++ b/libgfortran/generated/sum_i4.c @@ -242,8 +242,8 @@ msum_i4 (gfc_array_i4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index 235a98e5fb7..7b7ca72aa71 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -242,8 +242,8 @@ msum_i8 (gfc_array_i8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c index 4e2071fa570..71e71dd91f0 100644 --- a/libgfortran/generated/sum_r10.c +++ b/libgfortran/generated/sum_r10.c @@ -242,8 +242,8 @@ msum_r10 (gfc_array_r10 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c index 47571d9b010..813cc33dd90 100644 --- a/libgfortran/generated/sum_r16.c +++ b/libgfortran/generated/sum_r16.c @@ -242,8 +242,8 @@ msum_r16 (gfc_array_r16 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_r17.c b/libgfortran/generated/sum_r17.c index d479f200a80..8e82e871bb2 100644 --- a/libgfortran/generated/sum_r17.c +++ b/libgfortran/generated/sum_r17.c @@ -242,8 +242,8 @@ msum_r17 (gfc_array_r17 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c index 227ea34124f..1b37711b99f 100644 --- a/libgfortran/generated/sum_r4.c +++ b/libgfortran/generated/sum_r4.c @@ -242,8 +242,8 @@ msum_r4 (gfc_array_r4 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c index d0d0c111d4c..294211ba9be 100644 --- a/libgfortran/generated/sum_r8.c +++ b/libgfortran/generated/sum_r8.c @@ -242,8 +242,8 @@ msum_r8 (gfc_array_r8 * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/m4/ifunction-s.m4 b/libgfortran/m4/ifunction-s.m4 index bc5ce55e81c..72793e435aa 100644 --- a/libgfortran/m4/ifunction-s.m4 +++ b/libgfortran/m4/ifunction-s.m4 @@ -244,8 +244,8 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/m4/ifunction-s2.m4 b/libgfortran/m4/ifunction-s2.m4 index 22ba00899d7..b936d7c392c 100644 --- a/libgfortran/m4/ifunction-s2.m4 +++ b/libgfortran/m4/ifunction-s2.m4 @@ -244,8 +244,8 @@ void } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr; diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4 index c80aa86c890..f3ab4ebd58d 100644 --- a/libgfortran/m4/ifunction.m4 +++ b/libgfortran/m4/ifunction.m4 @@ -232,8 +232,8 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, } len = GFC_DESCRIPTOR_EXTENT(array,dim); - if (len <= 0) - return; + if (len < 0) + len = 0; mbase = mask->base_addr;