From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2e.google.com (mail-vk1-xa2e.google.com [IPv6:2607:f8b0:4864:20::a2e]) by sourceware.org (Postfix) with ESMTPS id 5415F3858D32 for ; Sun, 8 Jan 2023 13:42:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5415F3858D32 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-vk1-xa2e.google.com with SMTP id n17so2191773vkq.2 for ; Sun, 08 Jan 2023 05:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=No3bGEAGPbI4C5fPgVwycOfzTxBC1cHmiz8qKypaWU0=; b=FxCOMb7CadNYcULQFv6uwvakgsvWMOvM+LTdbJpi+AwBqNufyxMQjJD7VH7QnkirI2 y1RmVFzu+Jtsa0t6GdyTMyYIKDLEsWOkarEF6uxcYGKNwGQN3lLlPCh2XNf7vBx2rpAj iCsrJ8rQeQ8GSIWl0DlbQh7sRrAZlz3J2hYSLhZPPU3D4IpMld/xcrasG9SbHgxQjWBm 3n+EPFF0aWOJVF8HWy/HXIXs96Ngwt5n51Dgq7PFjN3CFcciZ49qqgSAYew1edepFJb8 bhM76u/4aNR9td/jkrcP4RCKJNFfhEy+LKLDITckZfrAIb4dnR1FgjaqerSDH3NBDRTa rT6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=No3bGEAGPbI4C5fPgVwycOfzTxBC1cHmiz8qKypaWU0=; b=AgBqYTHJ8OxKLpMlhq0huWOo1JGfWUDQix8uCY0kcyPpxMsRNAW73Bs2ICw7mj3igN wH38ULe1RBEfO4JpmPJCdQZb7E+8TCCUIvDYijXU1zdVGhoFUVSvYH7O0JSsMmjwzDL3 pkM6RCm1wDNjxTLpWu42PNh7tXLn2OxMEjH4niHTWri88eE0utcBVzyMBkcZpVNqhe9i RJVhTdKZ2CSCcn2trGuy5j5VIdUgbzxaf6O25YrzUp80gdZkJVXza4yvPXV6nqt1YYra di8FT4VcDDEfy6GuzQ2uU82PxfE5dFztfEHgGPYukzoUheaqlei6utfDRbzQ38QV8Hiu t57A== X-Gm-Message-State: AFqh2kqb8gU2xbRooIxX4aufBvPw9+ZkUZFxtON8Q+s+gC9IxoD/dOzI O91/cCyUDAr0X52JHn+25P4TzuCpuukS31QwCD8= X-Google-Smtp-Source: AMrXdXsCAwsQdK8wwK5HR+ygNNp4R+9XxhwuDfaE9FL7wXoYreN6yhIU0W0LLeOIfh4nImzUzqL24frw8+Ry//UJWyg= X-Received: by 2002:a1f:ac41:0:b0:3d5:63ee:dae1 with SMTP id v62-20020a1fac41000000b003d563eedae1mr5836039vke.9.1673185343638; Sun, 08 Jan 2023 05:42:23 -0800 (PST) MIME-Version: 1.0 References: <7ab973cd-f62e-28be-36e8-4e44252a4a38@gmx.de> <061aee5b-c27c-3a9f-419d-9893c2d744c4@netcologne.de> <78aafe8c-dcf9-55e6-50ce-c6289ea1f3fe@gmail.com> <484fa25a-430a-017f-839e-cb57201ada84@netcologne.de> In-Reply-To: <484fa25a-430a-017f-839e-cb57201ada84@netcologne.de> From: Paul Richard Thomas Date: Sun, 8 Jan 2023 13:42:12 +0000 Message-ID: Subject: Re: Fw: Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization To: Thomas Koenig Cc: Harald Anlauf , Jerry D , fortran Content-Type: multipart/alternative; boundary="0000000000000d109f05f1c0d2c5" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: --0000000000000d109f05f1c0d2c5 Content-Type: text/plain; charset="UTF-8" Hi Thomas, I was thinking of a function in resolve.cc, similar to generate_component_assignments that would generate the final call and, where necessary, generate a temporary and place rhs finalization after the assignment. Since this would only involve ordinary assignment and subroutine calls, I think that it is compatible both with forall and where constructs. I guess that I should check whether or not generate_component_assignments should not be placed within frontend_passes.cc. This part of resolve.cc precedes your efforts, I believe. Generating the final calls in the frontend would eliminate a substantial amount of rather opaque code. Best regards Paul On Sun, 8 Jan 2023 at 12:03, Thomas Koenig wrote: > Hi Paul, > > > What causes the ICES? > > There were a few PRs along this line. Usually, it is the > front-end pass inserting code which is illegal Fortran, and > the later stages then asserting that it doesn't happen. > > Here are a few examples: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50690 (function > elimination in OMP Workshare) > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50564 (forall) > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69154 (matmul > in where) > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69742 (in > associate). > > If you want to do the finalization of function results via > a front end pass, creating a variable and then assigning it > from within these constructs can cause these kinds of problems. > > Best regards > > Thomas > -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein --0000000000000d109f05f1c0d2c5--