From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121989 invoked by alias); 18 Oct 2018 10:39:00 -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 121967 invoked by uid 89); 18 Oct 2018 10:38:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:q6-v6mr X-HELO: mail-yb1-f195.google.com Received: from mail-yb1-f195.google.com (HELO mail-yb1-f195.google.com) (209.85.219.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Oct 2018 10:38:58 +0000 Received: by mail-yb1-f195.google.com with SMTP id k132-v6so495716ybc.2; Thu, 18 Oct 2018 03:38:57 -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:content-transfer-encoding; bh=sSoXEg+RkDAM7vjUASoqmi28oyf81oOIpjA629GFryw=; b=V/BXZ7VlQ8Wqsbx/lZ5VVujYGg8Oa/9gUdde9Ajglk6O0KcmYQp0YKXVPejyPatEnT D8PChdmvHD84smQjPxbL3QjNZoIHEWQ4dISOEQYAGRHC04MsXpIK5xQztt0rVFvM5MUN kwFrO0nSCSiv6o73ow86cTzWOAkGk/avRRu2ec4JCZiS8odYHGqmonfYJz2Opa1jeEpT 8uFNYAToOfkizsuQvzgUqHbajQYbFZ4DGaaRPUoFn6EASVvcOVOwEy4+VXU/fFgS339s gvEXx7mcjBuursuwLPXb2fYHoQ4jziHIQSwL0a25Rt8EKbXha/Omq6Q78LiG58lMpl2s e6eQ== MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Thu, 18 Oct 2018 10:39: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: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00089.txt.bz2 Patch for the PR70149 regression committed as revision 265263. Likewise the patch for PR58618 has been committed as revision 265264. Cheers 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