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 D90773858D39 for ; Tue, 28 Mar 2023 15:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D90773858D39 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=1680017477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1hIaiW/NGr1MjdECh84UzHHgYUwKD8A6CgtUTp6bj94=; b=DJnic/lfAexzBXoN7chUE59yuO6wUIwKkpeTzmLQ7Wqw9u9ClVHRkX2a7n5pwm34WmGmkq FXfo8SQ/HuoReZun76dI2NAKHamwA8fHdh0AGK2NO1wOm8AawXCo/9OZlUtqjH/n7Al1JI OOXo5yy+KuV0vWW7kQk2MLXfQiDIyy0= 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-231-0fXiG_0_P-KopAKJxtdwPw-1; Tue, 28 Mar 2023 11:31:15 -0400 X-MC-Unique: 0fXiG_0_P-KopAKJxtdwPw-1 Received: by mail-qk1-f200.google.com with SMTP id s12-20020a37a90c000000b007468eaf866aso5840292qke.17 for ; Tue, 28 Mar 2023 08:31:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680017475; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1hIaiW/NGr1MjdECh84UzHHgYUwKD8A6CgtUTp6bj94=; b=vl9qxz2+GVJtPerNo9rT/zncqxH6xFJ2y5oEamgjpuGw5Y6kkB9Od81CSSOsvYhOTk 4TXzmVSMDKOaJEGtQSFCl+8lZ8DRohzHuPiLQHvOK4UK//ueiaKzPe9wmV1ga8q+7hXk hMEwx4rf/tQbjutr/u9imGA4nkDQ5wecATeUIlhaJoJr7OJNcZS6ouWX1HUwY09S5voQ Z4eIyrImfve9+LNVNup2/tZO56z+o6dgQLXCgzczOzao59aXfHzSN+JbgtCqDJSfW9LB 0RhZQ+AQoYe//U+83oU2fb6FxDvYfixSmaLjSdDYz4yKCfJePmrkh0SxW3GrIZ2kkTpm PkMQ== X-Gm-Message-State: AO0yUKXDhXBDeP9YVm16VxkgTbATQtMlP+AAt+DbeoBqAzS4GkDHAE4d qY6ToELVAkCNNiqUlQIOkBUFWR54BT2u5HsE88kVFE6sKL0Hg1LClsFWHFdVvUGXbEoLJosDd7A vmu2kCVcYsoeYOuoLmg== X-Received: by 2002:ac8:5a0e:0:b0:3ba:1f09:94ab with SMTP id n14-20020ac85a0e000000b003ba1f0994abmr25296775qta.57.1680017475094; Tue, 28 Mar 2023 08:31:15 -0700 (PDT) X-Google-Smtp-Source: AKy350Yc/fKvD2ZFT0VuYPdbqrNlKYLKDqQkZiHSyNETKjwiT8nKwnsu+/hsaz5jeSV0VVJqm2xZQw== X-Received: by 2002:ac8:5a0e:0:b0:3ba:1f09:94ab with SMTP id n14-20020ac85a0e000000b003ba1f0994abmr25296747qta.57.1680017474797; Tue, 28 Mar 2023 08:31:14 -0700 (PDT) Received: from [192.168.1.108] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id p13-20020ac8460d000000b003d5358ffa83sm2801876qtn.62.2023.03.28.08.31.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Mar 2023 08:31:14 -0700 (PDT) Message-ID: <54c69a7a-540d-84e2-f8a3-d2a219c6a208@redhat.com> Date: Tue, 28 Mar 2023 11:31:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH RFC] c-family: -Wsequence-point and COMPONENT_REF [PR107163] To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <20230323203507.2960052-1-jason@redhat.com> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 3/24/23 18:25, Jakub Jelinek wrote: > On Fri, Mar 24, 2023 at 06:11:44PM -0400, Jason Merrill wrote: >>> 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; >>> ? >> >> Is clearing 'writer' what we want, since an access to COMPONENT_REF is an >> access to (a subobject of) its op0? > > I've just mindlessly copied the unary op case. > writer is set for pre/post increments and lhs of MODIFY_EXPR, and it is > true that VIEW_CONVERT_EXPR doesn't clear it, but e.g. ARRAY_REF clears it > for all operands. For whatever reason leaving writer set led to lots of false positives, so I've gone with your suggestion. >> Currently with the fix it takes <1s while gcc12 takes ~80s. > > Perfect. > >> PR c++/107163 >> >> gcc/c-family/ChangeLog: >> >> * c-common.cc (verify_tree): Don't use sequenced handling >> for COMPONENT_REF. >> >> gcc/testsuite/ChangeLog: >> >> * g++.dg/template/recurse5.C: New test. > > LGTM, thanks. Maybe the testcase would be better as > warn/Wsequence-point-5.C, dunno. Done. Jason