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.133.124]) by sourceware.org (Postfix) with ESMTPS id 1F2713858CDB for ; Thu, 23 Mar 2023 21:03:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2713858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679605436; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=pK5qqekdx8brRlvuNtdn4psQ2JXikY1qtl+MkIOH8G0=; b=I6G187kPaEQiv2Je5RLCBBZ8XPAd2uJWXBr+dP18tPfXcuNsH/2UkqrxRcZ0pI+WIjrwqK TKb7/6jZUJSKiNEYREj47rRbp4asi2uhttOPm5xBJTy1lpJvUrezs7zQ4+r6vw8UomhiFH xOf9+KbMkmzb3X8Pj38MI/FQ+LhDALc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-qJ8p5nYwO86WU8Ebm3p_Jg-1; Thu, 23 Mar 2023 17:03:37 -0400 X-MC-Unique: qJ8p5nYwO86WU8Ebm3p_Jg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0CA0185A78F for ; Thu, 23 Mar 2023 21:03:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70E5F40C6E67; Thu, 23 Mar 2023 21:03:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 32NL3Z653724118 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 22:03:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32NL3Y8A3724117; Thu, 23 Mar 2023 22:03:34 +0100 Date: Thu, 23 Mar 2023 22:03:34 +0100 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH RFC] c-family: -Wsequence-point and COMPONENT_REF [PR107163] Message-ID: Reply-To: Jakub Jelinek References: <20230323203507.2960052-1-jason@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230323203507.2960052-1-jason@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On Thu, Mar 23, 2023 at 04:35:07PM -0400, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu. Jakub, does this make sense to you? Do we have a > way of testing for compile-hog regressions? > > -- 8< -- > > The patch for PR91415 fixed -Wsequence-point to treat shifts and ARRAY_REF > as sequenced in C++17, and COMPONENT_REF as well. But this is unnecessary > for COMPONENT_REF, since the RHS is just a FIELD_DECL with no actual > evaluation, and in this testcase handling COMPONENT_REF as sequenced blows > up fast in a deep inheritance tree. > > PR c++/107163 > > gcc/c-family/ChangeLog: > > * c-common.cc (verify_tree): Don't use sequenced handling > for COMPONENT_REF. When we touch this for COMPONENT_REF, shouldn't we then handle it as unary given that the second operand is FIELD_DECL and third/fourth will likely be NULL and even if not, aren't user expressions that should be inspected? So, instead of doing this do: case COMPONENT_REF: x = TREE_OPERAND (x, 0); writer = 0; goto restart; ? As for compile-hog, depends on how long it will take it to compile before fix/after fix. If before fix can be above the normal timeout on reasonably fast matchines and after fix can take a few seconds, great, if after fix would take longer but still not horribly long, one way to do it is guard the test with run_expensive_tests effective target. Or another way is have the test smaller in complexity normally and // { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } and #ifdef EXPENSIVE make it more complex. Jakub