From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113909 invoked by alias); 18 Oct 2018 10:10:52 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 113889 invoked by uid 89); 18 Oct 2018 10:10:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=30th, shortly, 265231 X-HELO: mail-yw1-f50.google.com Received: from mail-yw1-f50.google.com (HELO mail-yw1-f50.google.com) (209.85.161.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Oct 2018 10:10:50 +0000 Received: by mail-yw1-f50.google.com with SMTP id l79-v6so11572641ywc.7; Thu, 18 Oct 2018 03:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wrrrF5p4JkjBOIqpoV+GCTilDRc75z2NNXGpCV/PqaU=; b=sHleW9T7f3CkcnNJqurJ6P+vmCMfv7JoCH2EFlKZoHjjp/7Y6F6UabeqvsVPMf3ehV rU/2ypau0SfLzWgPdljcezfDjcW7S1+TW6zcXyq2AOgatR4zSwU1FgOqoecAXRPU4pMx 9rRvdukXvLSnMuX+l8pN6BSFBVks2G0201CDBMmbgApe3aN0sKVTlkTuZXfbLKLrsZUY n6/u0JzPtrdNGmyo6+MmDQ5x3Hi8f6FmyOWnrq5qZZFk3WiLSMh98i+pEZFwR+cwtOoI IMyG6uP7vzYtKsp3feFekhmkgniRCObx1PhM4uv+jE1Y35q8/t8itawoSMGN1Iu9JMaw o5xg== MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Thu, 18 Oct 2018 10:10:00 -0000 Message-ID: Subject: Re: [Patch, fortran] PR58618 - Wrong code with character substring and ASSOCIATE To: Tobias Burnus Cc: "fortran@gcc.gnu.org" , gcc-patches Content-Type: multipart/mixed; boundary="0000000000003bcd5b05787e001b" X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00088.txt.bz2 --0000000000003bcd5b05787e001b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-length: 1946 I do not think that there will be a PR for the ICE. This is a regression introduced by my patch for PR70149 (September 30th). A patch is attached. I will commit it as 'obvious' as soon as it has finished regtesting. I will also commit the patch for PR58618 shortly afterwards. Thanks for the review. Paul On Wed, 17 Oct 2018 at 22:17, Tobias Burnus wrote: > > Hi Paul, > > Paul Richard Thomas wrote: > > This problem concerned associate targets being substrings. It turns > > out that they are returned as pointer types (with a different cast for > > unity based substrings ***sigh***) and so can be assigned directly to > > the associate name. The patch quite simply removed the condition that > > such targets be allocatable, pointer or dummy. > > I noticed in the course of working up the testcase that > > character (:), pointer :: ptr =3D> NULL() > > character (6), target :: tgt =3D 'lmnopq' > > ptr =3D> tgt > > print *, len (ptr), ptr > > end > > ICEs on the NULL initialization of the pointer but works fine if this > > is removed. Has this already been posted as a PR? > > > I leave it to Dominique to search for a PR; otherwise, I believe the > attach patch fixes the issue. =E2=80=93 It just needs someone to package = it with > a test case, regtest and commit it. > > > > Bootstrapped and regtested on FC28/x86_64 - OK for trunk? > > OK =E2=80=93 thanks for the fix. > > Tobias > > > 2018-10-17 Paul Thomas > > > > PR fortran/58618 > > * trans-stmt.c (trans_associate_var): All strings that return > > as pointer types can be assigned directly to the associate > > name so remove 'attr' and the condition that uses it. > > > > 2018-10-17 Paul Thomas > > > > PR fortran/58618 > > * gfortran.dg/associate_45.f90 : New test. --=20 "If you can't explain it simply, you don't understand it well enough" - Albert Einstein --0000000000003bcd5b05787e001b Content-Type: text/x-patch; charset="US-ASCII"; name="ice.diff" Content-Disposition: attachment; filename="ice.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jnefcrpn0 Content-length: 2530 SW5kZXg6IGdjYy9mb3J0cmFuL3RyYW5zLWRlY2wuYwo9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09CioqKiBnY2MvZm9ydHJhbi90cmFucy1kZWNsLmMJKHJldmlz aW9uIDI2NTIzMSkKLS0tIGdjYy9mb3J0cmFuL3RyYW5zLWRlY2wuYwkod29y a2luZyBjb3B5KQoqKioqKioqKioqKioqKiogZ2ZjX2dldF9zeW1ib2xfZGVj bCAoZ2ZjX3N5bWJvbCAqIHN5bSkKKioqIDE3NjIsMTc2OCAqKioqCiAgICAg ICAgZ2ZjX2ZpbmlzaF92YXJfZGVjbCAobGVuZ3RoLCBzeW0pOwogICAgICAg IGlmICghc3ltLT5hdHRyLmFzc29jaWF0ZV92YXIKICAJICAmJiBUUkVFX0NP REUgKGxlbmd0aCkgPT0gVkFSX0RFQ0wKISAJICAmJiBzeW0tPnZhbHVlICYm IHN5bS0+dmFsdWUtPnRzLnUuY2wtPmxlbmd0aCkKICAJewogIAkgIGdmY19l eHByICpsZW4gPSBzeW0tPnZhbHVlLT50cy51LmNsLT5sZW5ndGg7CiAgCSAg REVDTF9JTklUSUFMIChsZW5ndGgpID0gZ2ZjX2NvbnZfaW5pdGlhbGl6ZXIg KGxlbiwgJmxlbi0+dHMsCi0tLSAxNzYyLDE3NjkgLS0tLQogICAgICAgIGdm Y19maW5pc2hfdmFyX2RlY2wgKGxlbmd0aCwgc3ltKTsKICAgICAgICBpZiAo IXN5bS0+YXR0ci5hc3NvY2lhdGVfdmFyCiAgCSAgJiYgVFJFRV9DT0RFIChs ZW5ndGgpID09IFZBUl9ERUNMCiEgCSAgJiYgc3ltLT52YWx1ZSAmJiBzeW0t PnZhbHVlLT5leHByX3R5cGUgIT0gRVhQUl9OVUxMCiEgCSAgJiYg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KKioqIDAgKioqKgotLS0gMSw5IC0tLS0KKyAhIHsgZGctZG8gY29tcGls ZSB9CisgIQorICEgRml4IGEgcmVncmVzc2lvbiBpbnRyb2R1Y2VkIGJ5IHRo ZSBwYXRjaCBmb3IgUFI3MDE0OS4KKyAhCisgICAgIGNoYXJhY3RlciAoOiks IHBvaW50ZXIgOjogcHRyID0+IE5VTEwoKSAhIFRoZSBOVUxMICgpIGNhdXNl ZCBhbiBJQ0UuCisgICAgIGNoYXJhY3RlciAoNiksIHRhcmdldCA6OiB0Z3Qg PSAnbG1ub3BxJworICAgICBwdHIgPT4gdGd0CisgICAgIHByaW50ICosIGxl biAocHRyKSwgcHRyCisgZW5kCg== --0000000000003bcd5b05787e001b--