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 D108C3858CDA for ; Wed, 13 Sep 2023 22:14:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D108C3858CDA 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=1694643247; 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=KA9OjNmy4qc6wA1OY+uO1yqlmltmPC2KbZPSpDZdmGo=; b=bcQ37MWCKytXtnU3I1I/FG75Hgiwd6w5INuSAocEYc/KONayKJGo0KbEv6+/FzmXSLREIs XSmPUAoa7rVRwlgVqQCSpnFp2qdbVL1d3z3kPpkmSBO+QE3a7H6TKjJ3DheII6Js3S9jd3 32enSo2PoHvNs+eKDHuwtHKLFmdzJx8= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-231-865_JVJuOt-QhYm1CngnlA-1; Wed, 13 Sep 2023 18:14:06 -0400 X-MC-Unique: 865_JVJuOt-QhYm1CngnlA-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-76dcf1d8905so44259585a.1 for ; Wed, 13 Sep 2023 15:14:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694643245; x=1695248045; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TE0m2bcdBi117BXgdhxzsk8e/dC9zAolHABhGZaiZ8U=; b=kMz6ymey6xYTEFBldy5b6zGiVa78AwJFrd/71ZJIBge6vsFDYJnrA25dsTr0CnDw3L WCj04zfLrM3g8AFpydLNtTJLrTWJJclFH57RbsJ62PAtthyebQUkWeHpTBDrGHko+wYM LQw/4PfEyrtgCZvkk2DKiTScqlTpnTskqA1dXsx0FFz/ArHLShM1L/Jxlthi7xDXvqte flh0TluZjLlVxjYvn7obcrD3z6HAvcIZ0/B+B8ptZYQlVVIvXtAO+ceSwMtPrzwa+4F/ ltLZJc+xfLegHFgo3u5Z5wvVXX6o3izxtHg3OGlaVUqKRNhVanftPNfB9lQH/u7QBAfw cn/w== X-Gm-Message-State: AOJu0YyeklCXf3YKKWJAb9YGSjIkBx/cVvmpLuOmOK0aFy8iK+tzwepI m5ITrtirq6U+Z0t4mEBiQTYZWV/wpEiKtgF1uMZUZa23HtBZJ++XSQNt6ASzsnNFOSd2FerQu0C qxstEN3UaAQR+IMuVFQ== X-Received: by 2002:ac8:5cce:0:b0:410:a5e9:b7f0 with SMTP id s14-20020ac85cce000000b00410a5e9b7f0mr3852098qta.3.1694643245435; Wed, 13 Sep 2023 15:14:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFudqf4UETumdXtqmJRtX7xd8T7A0GHDuYUNd/HhmKfc2Tcnt5PqRaBuQ4r9RH6oAyePqCD5A== X-Received: by 2002:ac8:5cce:0:b0:410:a5e9:b7f0 with SMTP id s14-20020ac85cce000000b00410a5e9b7f0mr3852086qta.3.1694643245188; Wed, 13 Sep 2023 15:14:05 -0700 (PDT) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id w13-20020ac86b0d000000b0041518c7864csm67141qts.93.2023.09.13.15.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 15:14:04 -0700 (PDT) Message-ID: <1e53a369024de6e7c5ad7451c207c64645f9eac0.camel@redhat.com> Subject: Re: [WIP RFC] analyzer: Move gcc.dg/analyzer tests to c-c++-common (3) [PR96395] From: David Malcolm To: priour.be@gmail.com, gcc-patches@gcc.gnu.org Cc: benjamin priour Date: Wed, 13 Sep 2023 18:14:02 -0400 In-Reply-To: <20230911174433.492082-1-vultkayn@gcc.gnu.org> References: <20230911174433.492082-1-vultkayn@gcc.gnu.org> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 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_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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 Mon, 2023-09-11 at 19:44 +0200, priour.be@gmail.com wrote: > From: benjamin priour >=20 > Hi, >=20 > Patch below is mostly done, just have to check the formatting. > Althought, I'd like your feedback on how to manage named_constants > from enum in C++. >=20 > I've checked and the analyzer works as expected with them. > However, C++ FE makes it so that given >=20 > enum > { > =C2=A0 NAMED =3D 0x1 > }; >=20 > then in analyzer-language.cc:maybe_stash_named_constant >=20 > =C2=A0=C2=A0=C2=A0 tree t =3D tu.lookup_constant_by_id (id); > =C2=A0=C2=A0=C2=A0 ... > =C2=A0=C2=A0=C2=A0 logger->log ("%qs: %qE", name, t); >=20 > t is printed as 1 in C, but NAMED in C++. > Should it be left as a "FE specifity", > or should we aim for 1 in C++ as well ? Thanks for the patch. It seems that the patch consists of three parts: (a) adding kf_bzero (b) refactoring/moving c_translation_unit so it can be used by g++ (c) a whole bunch of tests being moved, some of which may depend on (a) and (b); are there some that don't? Given how big the (c) changes look like in a "diff", I'd prefer the (a) and (b) changes to be split out as preliminaries, for readability. =C2=A0 Presumably this change could be made part of (a): =09* gcc.dg/analyzer/bzero-1.c: Moved to... =09* c-c++-common/analyzer/bzero-1.c: ...here. Does anything in the patch actually use (b)? IIRC it's used by the file-descriptor tests, so fd-*.c, pipe-*.c, etc. As for your question, lookup_constant_by_id should return an INTEGER_CST (or NULL_TREE), so presumably we want t to be printed as '1' with both frontends. Dave