From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id B0C963858C74; Sun, 14 May 2023 15:24:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0C963858C74 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-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-50bc4b88998so20774130a12.3; Sun, 14 May 2023 08:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684077873; x=1686669873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=GwFE6GsJzJ8GYXLOIuykLl5Pzy/im24WkeUX7PyMvIA=; b=dtxZmdlGXwQ+IRd4VHAeHr1ZkpEcjHz7Ta4UR9/rclbw/sDQeSgtv+H8SUy+DUG7xc PYXtuw3Cfcxu2vC4HSsH+j4AlInn4Q5R1AabXX7lfNg4mkvQlW1yqGmQYbQAqyCl0lxz bUZ0yBaak14UU6wEWiixFLMQa1JeOXLW06S2zOb8rnt059PodvB6TkHilDk+isMYBW+T pE558hj9A58RE7qsMiZGCgY8wfTWD2My0dZ+mH2TRvFkYQ5XqabE32i6MR8QnDAscsgE Fq9hq5WKAflSfN8F33Y2oxART0HLPLOQkUTwtynvcS4qhc2Zaap/Ueapez/X7Zw+vdL2 2gbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684077873; x=1686669873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GwFE6GsJzJ8GYXLOIuykLl5Pzy/im24WkeUX7PyMvIA=; b=dO/zNRo0asvKCURHdBR6piLfJKSm5TF/1G6gnH1U6H/l07h0adflQ8ex+eCnzAZ+hS oY/iZwAGUHAPmWtyhuPxr/d+Vq7qStwOfNPEw4koeUKDJOqTSa+pfaG2Xh21jv9U4D4H uKg/wwqmrVN4675l0ewbtXli+EhOcTTCZs9hhC7Su/5Sv80mHOzaIc2hCgMdDBNSRsLH 5Ql5/6XHf7FFGKB3sCWye5c0RdkfOT8vlULiHordd2Hm8ax1FIJHq5CcwS2zHaLjMiy1 RsJAk8u+0yK3ENIVuQcdEp0t74r6ItOF0Z8qbPxAdFdxNiRdechvhnWfDwpU+WRlNmSM seUA== X-Gm-Message-State: AC+VfDxx6zRrj77auE+G3FmgXNaMbQ8QS5+AO7ilklBMJmJSjaqEib0R 63np1ZDYWBW6MhkdvcGvaaY= X-Google-Smtp-Source: ACHHUZ5DD/R7VZAK/DOYVuS06NBUEysnE0+XxAvOj36uKks9FNJVz2d6Q6aBoaH7PK6nby9zrOOiAw== X-Received: by 2002:a17:907:3207:b0:94f:5b91:7952 with SMTP id xg7-20020a170907320700b0094f5b917952mr26241380ejb.21.1684077872939; Sun, 14 May 2023 08:24:32 -0700 (PDT) Received: from nbbrfq ([2001:871:227:ce8b:afc3:c345:e1dd:564e]) by smtp.gmail.com with ESMTPSA id t12-20020a1709060c4c00b0096ace550467sm2681435ejf.176.2023.05.14.08.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 08:24:32 -0700 (PDT) Date: Sun, 14 May 2023 17:24:28 +0200 From: Bernhard Reutner-Fischer To: Thomas Koenig Cc: Mikael Morin , fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer Subject: Re: [PATCH v2] Fortran: Narrow return types [PR78798] Message-ID: <20230514172428.2ff11996@nbbrfq> In-Reply-To: <284716f0-fe76-dc88-e5be-4af0f65e13f4@netcologne.de> References: <8B220543-5633-47CA-8DF9-0381613CBDF3@gmail.com> <20230510164719.155783-1-rep.dot.nop@gmail.com> <284716f0-fe76-dc88-e5be-4af0f65e13f4@netcologne.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, 14 May 2023 15:04:15 +0200 Thomas Koenig wrote: > On 14.05.23 14:27, Mikael Morin wrote: > >=20 > > (...) =20 > >> @@ -2098,7 +2098,7 @@ ref_same_as_full_array (gfc_ref *full_ref,=20 > >> gfc_ref *ref) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 there is some k= ind of overlap. > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 : array references are identical or n= ot overlapping.=C2=A0 */ > >> -int > >> +bool > >> =C2=A0 gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *re= verse, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 boo= l identical) > >> =C2=A0 { =20 > >=20 > > The function comment states that the function may return 2, which=20 > > doesn't seem to be the case any more. =20 >=20 > Hm, this makes me a litte suspicious. Was functionality for reversing > loops lost, maybe unintentionally? I assume that, at some time, we did > use the '2' as return value (or did we?) There was 7c428aa29d75ef163c334cf3974f87b3630d8b8b (a revert because it miscompiled spec2k) which might have associated the comment of the former static gfc_dependency dep_ref (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse) to the current gfc_dep_resolver. The commit which introduced the return value 2 documentation was 3d03ead0b8273efde57f6194617b35111a84b05d=20 "re PR fortran/24524 (Fortran dependency checking should reverse loops)" but TBH i don't see how it returned 2 in that revision? Looks like when writing that patch it deemed useful to return 2 for this specific situation but in the end it was dropped but the comment survived. I will update the comment to document the true / false return values. And Mikael, do you want me to cleanup 1/0 to true/false assignments for the boolean variables, or can we do that in a separate patch (or not at all right now)? many thanks for the reviews!