From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EFA183858D20 for ; Mon, 28 Feb 2022 19:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EFA183858D20 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-311-E_PD9y8ZPzin3Uw81wDBcA-1; Mon, 28 Feb 2022 14:21:30 -0500 X-MC-Unique: E_PD9y8ZPzin3Uw81wDBcA-1 Received: by mail-qk1-f200.google.com with SMTP id 199-20020a3703d0000000b005f17c5b0356so12102730qkd.16 for ; Mon, 28 Feb 2022 11:21: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:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=h3jiDbUTxNG6jruyiufjWbNV8/mQCcpKvztUZtXcnks=; b=X2AEAhougzlY3a2yy1Kzk7TF8h7IYAIhhscwM1ajrpMoPOytTAJLw2AtFUPxZVMAJU nNU6Nly4qlv6Hfxi7F8cY9beehZxH49VC+WvGBgpd9o3Ya8Gva//Poq3Pxi5Msvv5c8G kY3PiDvNlvnRV93DjUn+KRuVwM2LmbOW2xjeVmo4uRlO+9x6usAIxdYOESIR5TVBlC27 fFi6SKAst1DtVZcQJJbIAzFe7HyLZ7Ym+W8iYS8KWnLbRxqEVVFOctJV091gs6sAmg5b RjmLMb1fvSBSwQb2nehBkDDsZbRA+/bC7QSeVOxQrGytS98Ik7gdQFJexL3THnV0G4DW mGpw== X-Gm-Message-State: AOAM530jL4BIuloclp2O8F+tnueUsjzxgTY4oQIFDJVveQZC9x0ezoZq 5l4dMAwF2iLWxjZcNezsFicJCFplEPxfVitsoI3E2KIKCJ2HF5qUR9/zYrhXXryQiP7oRZHWO3V VDob4IDZoVOvl1lM2DQ== X-Received: by 2002:ad4:5941:0:b0:433:75f:8627 with SMTP id eo1-20020ad45941000000b00433075f8627mr6406081qvb.122.1646076090004; Mon, 28 Feb 2022 11:21:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxB2IqMywdXKylsmg43//HeMct3PTtIW9yUTBAghr1S5rCWjPBAvXAYAAqsNZ6YyZppAAJ6+g== X-Received: by 2002:ad4:5941:0:b0:433:75f:8627 with SMTP id eo1-20020ad45941000000b00433075f8627mr6406069qvb.122.1646076089736; Mon, 28 Feb 2022 11:21:29 -0800 (PST) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id o19-20020a05620a22d300b0046d7f2a6841sm5380098qki.74.2022.02.28.11.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:21:29 -0800 (PST) Message-ID: <861837e00b8c8fb3cc061461077d577b3d0b370c.camel@redhat.com> Subject: Re: [PATCH] Fix error recovery in toplev::finalize. From: David Malcolm To: Richard Biener Cc: Martin =?UTF-8?Q?Li=C5=A1ka?= , gcc-patches@gcc.gnu.org Date: Mon, 28 Feb 2022 14:21:27 -0500 In-Reply-To: <63FA516D-66BD-4D86-917E-9021F0394683@gmail.com> References: <815163c0f6c7272d8095496a429b5aa5be38eee8.camel@redhat.com> <63FA516D-66BD-4D86-917E-9021F0394683@gmail.com> User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 19:21:34 -0000 On Mon, 2022-02-28 at 18:47 +0100, Richard Biener wrote: > > > > Am 28.02.2022 um 16:31 schrieb David Malcolm via Gcc-patches < > > gcc-patches@gcc.gnu.org>: > > > > On Mon, 2022-02-28 at 12:49 +0100, Martin Liška wrote: > > > Use flag_checking instead of CHECKING_P > > > and run toplev::finalize only if there is not error seen. > > > > > > Patch can bootstrap on x86_64-linux-gnu and survives regression > > > tests. > > > > Did the testing include the libgccjit test suite?  ("jit" is not in - > > - > > enable-languages=all) > > > > > > > > Ready to be installed? > > > > I'm not keen on this change; IIRC it's valid to attempt to compile a > > gcc_jit_context that fails with an error, and then to attempt a > > different gcc_jit_context that succeeds, within the same process.  If > > I'm reading the patch right, the patch as written removes this > > cleanup, > > which would thwart that. > > > > I can try to cook up a testcase for the above use case. > > > > Is there another way to fix PR 104648? > > The function was never called on a release checking build btw.  Is > there something like flag_jit one could test? Sorry, I was misremembering - with libgccjit, toplev.finalize () is called from playback::context::compile in jit/jit-playback.cc, not here from main.cc So this cleanup would still be called for libgccjit, and the patch doesn't affect that. Looking at PR ipa/104648, it seems to only be triggerable from the C++ frontend, so can't affect libgccjit. So I think the patch is OK; sorry for the noise. Dave > > > Thanks > > Dave > > > > > > > > > Thanks, > > > Martin > > > > > >         PR ipa/104648 > > > > > > gcc/ChangeLog: > > > > > >         * main.cc (main): Use flag_checking instead of CHECKING_P > > >         and run toplev::finalize only if there is not error seen. > > > > > > gcc/testsuite/ChangeLog: > > > > > >         * g++.dg/pr104648.C: New test. > > > --- > > >   gcc/main.cc                     | 6 +++--- > > >   gcc/testsuite/g++.dg/pr104648.C | 9 +++++++++ > > >   2 files changed, 12 insertions(+), 3 deletions(-) > > >   create mode 100644 gcc/testsuite/g++.dg/pr104648.C > > > > > > diff --git a/gcc/main.cc b/gcc/main.cc > > > index f9dd6b2af58..4ba28b7de53 100644 > > > --- a/gcc/main.cc > > > +++ b/gcc/main.cc > > > @@ -37,9 +37,9 @@ main (int argc, char **argv) > > >                  true /* init_signals */); > > >   > > >     int r = toplev.main (argc, argv); > > > -#if CHECKING_P > > > -  toplev.finalize (); > > > -#endif > > > + > > > +  if (flag_checking && !seen_error ()) > > > +    toplev.finalize (); > > >   > > >     return r; > > >   } > > > diff --git a/gcc/testsuite/g++.dg/pr104648.C > > > b/gcc/testsuite/g++.dg/pr104648.C > > > new file mode 100644 > > > index 00000000000..b8b7c2864cf > > > --- /dev/null > > > +++ b/gcc/testsuite/g++.dg/pr104648.C > > > @@ -0,0 +1,9 @@ > > > +// { dg-do compile } > > > +// { dg-options "-fvtable-verify=preinit" } > > > + > > > +struct A {}; > > > +struct B : virtual A > > > +{ > > > +  B () {}; > > > +  B () {}; /* { dg-error "cannot be overloaded with" } */ > > > +}; > > > > >