From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 293A73858D28; Thu, 22 Jun 2023 06:19:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 293A73858D28 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-pg1-x532.google.com with SMTP id 41be03b00d2f7-5440e98616cso213440a12.0; Wed, 21 Jun 2023 23:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687414789; x=1690006789; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Q5G0JJsia0BvIcmrgw+Atx6jcTZ2tITrjnqeF7l+5Ug=; b=s0qccqcsFTsoPZGhqS8V00PVGa3d8yxtOy0NVLPHdeRk3ZdLg8BGXiEqs3D5gdXIPe mFtjMbTHf7RiCirG5hGE5AbI0KKuY6AnyM4T8ESMitfLPmDCCxDTBPTdmzAxAvtDXJfR 24zsrJvyaxF1sP1rM5zExvIovVrTMY/BezdsziNa/I6qKKm1UUiBRH3tGD6J2S4jCHVO eb34Y3pt0atJhNwFBWCdYO5nj2y8DpnFW/3omB28EutXH87idE0QF4PJ0b4l6ulJbTs0 GsVtjKZ3Do+Yno93oBDDecCSVUaVwP7mOmtaNjZBH9IOmhzJ8PgYTAxZwx8tkSAmxwz1 DJQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687414789; x=1690006789; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Q5G0JJsia0BvIcmrgw+Atx6jcTZ2tITrjnqeF7l+5Ug=; b=F0f86zIEmibTKHS7Z7q695eslPkxWUL4Tu2SRQuBrHpwItZHtEgR6S4zdYZzTDwZc5 BNc45DmfNBoYGnhll0/L1NcFdvGYF5MB6RaGcjNviTRwohjqAHMRln5ZXMMX2xSarvdi iDdR9/zsq+Alvn7g1Y4mYXE8YQqk6cWp3v+T1Hvmi3G+wclWLD3byJaZO3zHIKoI7V42 MVkgDAg5l53tokQ/4OZ8tdSZ7NmwSQV6kc4Kp5Rh/Pucv1xl/8s6wVFJ3pfvbll/hfuO CmoR7p0vTi58nCO27xtIe2RPwHUgm4SxP8lWAeXsVmg6bB/x/7FBRO20Mc3pKG/L3ZFb aAGg== X-Gm-Message-State: AC+VfDwAUASVC438No8Fno7ACOKxt+U+ta4ytpFkUTBAJyPQKNTRheKe LjgstTGC0tL26Xoxjt8KP8yx7bG8tErYNoY9Fro= X-Google-Smtp-Source: ACHHUZ45wSwkgZUD+LlFZb6L3AgSM6DlO9ajnAh3hBUUjyTsqy5NsNx2BcjDG/cDbg4ea3gfU/03qo/6KNPB/cq4Y90= X-Received: by 2002:a17:90a:ae0b:b0:256:2526:2de5 with SMTP id t11-20020a17090aae0b00b0025625262de5mr31792194pjq.13.1687414788857; Wed, 21 Jun 2023 23:19:48 -0700 (PDT) MIME-Version: 1.0 References: <358e8e69-8fc9-8d00-7fde-9aaa86371c87@gmx.de> <20230621211747.7d4a0dc9@nbbrfq.loc> In-Reply-To: <20230621211747.7d4a0dc9@nbbrfq.loc> From: Paul Richard Thomas Date: Thu, 22 Jun 2023 07:19:37 +0100 Message-ID: Subject: Re: [Patch, fortran] PR107900 Select type with intrinsic type inside associate causes ICE / Segmenation fault To: Bernhard Reutner-Fischer Cc: Paul Richard Thomas via Fortran , Harald Anlauf , gcc-patches , Steve Kargl Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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: Hi Both, > while I only had a minor question regarding gfc_is_ptr_fcn(), > can you still try to enlighten me why that second part > was necessary? (I believed it to be redundant and may have > overlooked the obvious.) Blast! I forgot about checking that. Lurking in the back of my mind and going back to the first days of OOP in gfortran is a distinction between a class entity with the pointer attribute and one whose data component has the class_pointer attribute. I'll check it out and do whatever is needed. > > + else if (context && gfc_is_ptr_fcn (assoc->target)) > > + { > > + if (!gfc_notify_std (GFC_STD_F2018, "%qs at %L associated to " > > + "pointer function target being used in a " > > + "variable definition context (%s)", name, > > + &e->where, context)) > > I'm curious why you decided to put context in braces and not simply use > quotes as per %qs? That's the way it's done in the preceding errors. I had to keep the context in context, so to speak. > > +/* Build the associate name */ > > +static int > > +build_associate_name (const char *name, gfc_expr **e1, gfc_expr **e2) > > +{ > > > + return 1; > > > + return 0; > > +} > > I've gone through the frontend recently and changed several such > boolean functions to use bool where appropriate. May i ask folks to use > narrower types in new code, please? > Iff later in the pipeline it is considered appropriate or benefical to > promote types, these will eventually be promoted. > > > diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc > > index e6a4337c0d2..18589e17843 100644 > > --- a/gcc/fortran/trans-decl.cc > > +++ b/gcc/fortran/trans-decl.cc > > > @@ -1906,6 +1915,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) > > gcc_assert (!sym->value || sym->value->expr_type == EXPR_NULL); > > } > > > > + > 'twas accidental. There had previously been another version of the fix that I commented out and the extra line crept in when I deleted it. Thanks for the spot. > > Please kindly excuse my comment and, again, thanks! > > > gfc_finish_var_decl (decl, sym); > > > > if (sym->ts.type == BT_CHARACTER) Regards Paul