From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id AF1EE3858400; Wed, 5 Jan 2022 12:44:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF1EE3858400 Received: by mail-qk1-x736.google.com with SMTP id de30so38135199qkb.0; Wed, 05 Jan 2022 04:44:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nFnCsLoW/ZNMAMWz8xWBiUs6WN4N0drcIZgE2gfxTGo=; b=RBTpT7S97pmuKeiKUEsOQ8VXqSFyfgfMp9JnrDEOmzK886Q3MEn6/awlCGYO/41x+b 7DYVAUo4rvFTeGDQRc8tGZYZRXyQCeSbT1Fd1KJ48DVUuF1z2m1iBjWNU6LAAldIM3qj Cj2Q2gF11Mu9qa3sWkadz9BV+fPU7LtLtfkQjbhDdjyyKhjJh3lYhiesufC1yhCUL4Iq d0nlENfXSlhiWAxke+HcLUGHCaAIzDFBLr0NykyJZ9UPZbVRpwBLnoBQsPLlRyYx0gE4 BQNhiHs5W9ZOTaEBnxi3/PEgylCyf/3DnO3NRbYFtzVF1qYel/IxK9f+t1C7qhz7pGpY VcJg== X-Gm-Message-State: AOAM530QQw9UVMso4kXFF75bijpeK9IUF210dEKEfXgIJVOXQrYv4BU/ ZK5ds8yQcTMxCxV7iaYByC3yi75a8/qqZrAU3m8= X-Google-Smtp-Source: ABdhPJzbCDcpDWfumZ7WbnGX5vrdEJ0kWxFFxxpp07I1zVeK7EQjGbfJ8XyIFb3YGIey6hs1uUUmj9Flms+AMdiHl0Y= X-Received: by 2002:a05:620a:4092:: with SMTP id f18mr37100933qko.629.1641386670191; Wed, 05 Jan 2022 04:44:30 -0800 (PST) MIME-Version: 1.0 References: <77c049b9-998c-ad9a-d3ff-8593b581e1f6@codesourcery.com> In-Reply-To: <77c049b9-998c-ad9a-d3ff-8593b581e1f6@codesourcery.com> From: Paul Richard Thomas Date: Wed, 5 Jan 2022 12:44:19 +0000 Message-ID: Subject: Re: [PATCH] Fortran: Fix ICE caused by missing error for untyped symbol [PR103258] To: Sandra Loosemore Cc: "fortran@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2022 12:44:33 -0000 Hi Sandra, That's a good shout to query suppress_errors. The patch is OK by me. Thanks Paul On Wed, 5 Jan 2022 at 03:21, Sandra Loosemore wrote: > This patch fixes an ICE that appeared after I checked in my patch for > PR101337 back in November, which made the resolve phase try harder to > check all operands/arguments for errors instead of giving up after the > first one, but it's actually a bug that existed before that and was only > revealed by that earlier patch. > > The problem is that the parse phase is doing early resolution to try to > constant-fold a character length expression. It's throwing away the > error(s) if it fails, but in the test case for this issue it was leaving > behind some state indicating that the error had already been diagnosed > so it wasn't getting caught again during the "real" resolution phase > either. > > Every bit of code touched by this seems kind of hacky to me -- the > different mechanisms for suppressing/ignoring errors, the magic bit in > the symbol attributes, the part that tries to constant-fold an > expression that might not actually be a constant, etc. But, this is the > least hacky fix I could come up with. :-P It fixes the test case from > the issue and does not cause any regressions elsewhere in the gfortran > testsuite. > > OK to check in? > > -Sandra > -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein