From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 554CB385802A; Tue, 16 Feb 2021 15:57:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 554CB385802A Received: by mail-lf1-x136.google.com with SMTP id d24so16579354lfs.8; Tue, 16 Feb 2021 07:57:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xUnQp2BmdBEsSZVTmFxB7IVe2vGYb7j6Lgoe6EBV/TE=; b=Sm4BOlew+bfXivSYsqgpZcw2PhsJJWwYpHB1EXVIURgD+0VuHNCuRUx0AsEhUXOL++ TNE9A/5DUkIrrcJvXrmab8Ri60jeaddUZS0iUEqZlAu7K7EivLV+lipfKbPIY15ATLLO VVV/5THljWW7Wf3EvLQgPSdJskH9XE/oLw/KLIlBDr6fAoJvUVBPPgXdtXzyZXH1WpgZ onDvMCNJoO+mp/cKPpSGdPwpQP3pwdovDrUjCoDjC9Eu1fiQhfRYgghWQJNGkCIiqIZy 4XafPFxIPr4uEZ5GmmLCOC4O25BkQUkaI/Mfg8lkE8aoiIUm0QjTFIHQze6fsgNzzxrg U/iw== X-Gm-Message-State: AOAM533tfZYcuSu7RiNYMCJ0fRBjx04ZJ7FLlGKde7qx8qUNCNr3j2xg cjM3PhFL2BP8IIN4KEgkWfZ1PO8Ld5qp1rcLAWQ= X-Google-Smtp-Source: ABdhPJziaeBZ/oX3GdP15aiWw9bTheNVPII1J6eqffI4SAuJz1hKG47Vl31VX/6F9SEdZu5imAGLj6d7k8PZQwf8V/o= X-Received: by 2002:a05:6512:1310:: with SMTP id x16mr11837013lfu.19.1613491052071; Tue, 16 Feb 2021 07:57:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Tue, 16 Feb 2021 15:57:20 +0000 Message-ID: Subject: Re: [Patch] Fortran: %re/%im fixes for OpenMP/OpenACC + gfc_is_simplify_contiguous To: Tobias Burnus Cc: gcc-patches , fortran , Jakub Jelinek , Thomas Schwinge X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2021 15:57:37 -0000 Hi Tobias, I think that constitutes an 'obvious' patch. OK for mainline. Thanks Paul On Mon, 8 Feb 2021 at 18:53, Tobias Burnus wrote: > Found when looking at Julian's 3/4 OpenACC patch, which has not > yet been committed (and needs still to be revised a bit.) > > The fix (a) avoids an ICE when Julian's patch has been applied. > The patch (b) just makes one error message less confusing. > > The testcase shows that only %re/%im run reach the new code as > %kind/%len are !=3D EXPR_VARIABLE. (The error message is slightly > misleading if the 'list item'/'var' is not a variable.) > > > (a) We need to handle REF_INQUIRY gfc_is_simplify_contiguous. > > That function is used for 'is_contiguous(a(:)%re)', but it works > without this patch and simplifies already to .false. > And it is used in openmp.c, which can ICE without this patch. > > (b) Just makes the error message nicer - as only EXPR_VARIABLE > reaches that code, only %re and %im are mentioned in the > error message. > > (Actually, it is not completely clear whether %re/%im are invalid > or not; I think they should be =E2=80=93 but one can argue otherwise. > For OpenMP I just saw that it is tacked internally in Issue 2661, > for OpenACC it is tracked as Issue 346 =E2=80=93 but neither has been > discussed, yet.) > > OK for mainline? > > Tobias > > PS: '%re'/'%im' permit accessing the real/imaginary part of a > complex variable as lvalue (in the C++ sense) and also permit > "var(:)%re =3D 1.0", which real(z) or imag(z) does not permit. > > var%kind =3D=3D kind(var), but derived types also permit > parameterized derived types (PDT), which can use '%foo' for respective > 'len' and 'kind' components. > > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen > Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thoma= s Heurung, Frank > Th=C3=BCrauf > --=20 "If you can't explain it simply, you don't understand it well enough" - Albert Einstein