From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 20A0F3858D28; Wed, 21 Jun 2023 19:17:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20A0F3858D28 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-wr1-x42e.google.com with SMTP id ffacd0b85a97d-311099fac92so7279117f8f.0; Wed, 21 Jun 2023 12:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687375077; x=1689967077; 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=3ib4MLS6mbJyfL+ROspHaTUkmXZzDsj7BWODVX5GgKc=; b=IzNrV7wZ3dqs8oMj+U5t0eB/ViK++7vQNRpLafHSJnukqrxcjj03vyx2L+Eo6rxWNM 6KaC99fDAT440yVjavVv0TQUxUHOgL1+PlJwhpeF0TlD+in1htPPnrjDSyyXdCljZN2n x5Ore1rDVZaenswyJ9BHP3sy6Wt0Vo2jDmn3XqkK/SYXHPbSdwXY3hhgPmcj4UhIiAi8 qQD9TiBZVItjmDOZSfDFKQU9RySzQZ7MCQtRvgqkrlIy08iMtKZ0AsJ4a9Qg+J9vRaA5 hD+IMywo8+72uU7UM/lb1xMRvAHdeVN3N4Zl/mOrBjBsO6/ErNtSJasPh2aEFvpfkNXb YSgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687375077; x=1689967077; 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=3ib4MLS6mbJyfL+ROspHaTUkmXZzDsj7BWODVX5GgKc=; b=KKWRfGkxRDWkYPxGJDC9Ffefz1XTfpEiVKn1RTzXzJAX2LdkaAIjRLN/311+SkI+2r 3yBXrR0/ok/NWWGDFZlrod44HfJl8U/CdGs75UNO6azVvB98wXwPpxldFbo+NIipp+Bv iup+C70TYnaSLDw4j5gqrud79y17akCR0DRrDZFILtkRoH5eG0HKJdc8lx8WGwtk03ms x4lJDL89BJEprME7kqFZC8oD/5BecI2sWNdfxQ2sn8CeAQEqQIFAmZKKkav2+hX3Uekd zpPgTS+vD9sXBcra8AQRyn4RBiXlgI+digNyh7hepOs9oSRJbtPOBi97s8x+iw39l8YK PC9Q== X-Gm-Message-State: AC+VfDxkQ9U6cXoeHHgkLfiKH5oxaFQDk0pwFTWWujAG6FmxLf72qxRF g71xc5wBLMZDoeFhspCiCSs= X-Google-Smtp-Source: ACHHUZ675FC/YZQ7bjZi6hHrSHVvv2qWcHyHtGGHGKvflnUxk+yMqDGug+xf2fV7ogXjpf83GI7ADQ== X-Received: by 2002:adf:ef50:0:b0:30f:cc45:5af1 with SMTP id c16-20020adfef50000000b0030fcc455af1mr13609773wrp.45.1687375076726; Wed, 21 Jun 2023 12:17:56 -0700 (PDT) Received: from nbbrfq.loc (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id p24-20020a1c7418000000b003f9c859894esm1707165wmc.7.2023.06.21.12.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 12:17:56 -0700 (PDT) Date: Wed, 21 Jun 2023 21:17:47 +0200 From: Bernhard Reutner-Fischer To: Paul Richard Thomas via Fortran Cc: rep.dot.nop@gmail.com, Paul Richard Thomas , Harald Anlauf , gcc-patches , Steve Kargl Subject: Re: [Patch, fortran] PR107900 Select type with intrinsic type inside associate causes ICE / Segmenation fault Message-ID: <20230621211747.7d4a0dc9@nbbrfq.loc> In-Reply-To: References: <358e8e69-8fc9-8d00-7fde-9aaa86371c87@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.7 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! First of all, many thanks for the patch! If i may, i have a question concerning the chosen style in the error message and one nitpick concerning a return type though, the latter primarily prompting this reply. On Tue, 20 Jun 2023 11:54:25 +0100 Paul Richard Thomas via Fortran wrote: > diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc > index d5cfbe0cc55..c960dfeabd9 100644 > --- a/gcc/fortran/expr.cc > +++ b/gcc/fortran/expr.cc > @@ -6470,6 +6480,22 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, > } > return false; > } > + 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? > + return false; > + else if (gfc_has_vector_index (e)) > + { > + gfc_error ("%qs at %L associated to vector-indexed target" > + " cannot be used in a variable definition" > + " context (%s)", > + name, &e->where, context); Ditto. > diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc > index e7be7fddc64..0e4b5440393 100644 > --- a/gcc/fortran/match.cc > +++ b/gcc/fortran/match.cc > @@ -6377,6 +6377,39 @@ build_class_sym: > } > > > +/* 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); > } > > + ISTM that the addition of vertical whitespace like here is in contradiction with the coding style. Please kindly excuse my comment and, again, thanks! > gfc_finish_var_decl (decl, sym); > > if (sym->ts.type == BT_CHARACTER)